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

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? ?

@nashby
Copy link
Collaborator

nashby commented Jun 24, 2024

@kriom hey! Thanks for the PR but I don't think it gives that much value to support one more way to pass a collection.

@nashby nashby closed this Jun 24, 2024
@kriom
Copy link
Author

kriom commented Jun 24, 2024

OK no problem, thanks for the answer

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

2 participants