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

Allow to give an object's method name as symbol define collection #1837

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kriom
Copy link

@kriom kriom commented Mar 19, 2024

Hi,

I would like to be able to give a method as symbol for the collection
with, for example

class User
  #...
  def locales
    [:"en-US", :"fr-FR", :"es-ES", :"ja-JP", :"zh-CN"]
  end
  #...
end

I would like to do that in my view

form.input(:locale, collection: :locales, include_blank: false)

rather than :

form.input(:locale, collection: form.object.locales, include_blank: false)

Is it feasible? ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant