Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fields :title and :description to allow lambda #3596

Open
jetienne opened this issue Jan 21, 2025 · 0 comments
Open

fields :title and :description to allow lambda #3596

jetienne opened this issue Jan 21, 2025 · 0 comments
Labels
Enhancement Not necessarily a feature, but something has improved Good first issue Good for newcomers Help wanted We could use some help with this

Comments

@jetienne
Copy link

jetienne commented Jan 21, 2025

Feature

When defining a :has_many field, it would be great to allow lambdas for :name and :description attribute. We could then display dynamic content like:

field :sent_invoices, 
         as: :has_many, 
         scope: lambda { query.sent }, 
         name: 'Sent Invoices', 
         description: lambda { "Total of #{query.sent.sum(:amount)}" }
@Paul-Bob Paul-Bob added Enhancement Not necessarily a feature, but something has improved Good first issue Good for newcomers Help wanted We could use some help with this labels Jan 21, 2025
@Paul-Bob Paul-Bob moved this to To Do in Issues Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Not necessarily a feature, but something has improved Good first issue Good for newcomers Help wanted We could use some help with this
Projects
Status: To Do
Development

No branches or pull requests

2 participants