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

Second arg for 'options for select' works in Rails 5 #27202

Closed
dare05 opened this issue Nov 28, 2016 · 3 comments
Closed

Second arg for 'options for select' works in Rails 5 #27202

dare05 opened this issue Nov 28, 2016 · 3 comments

Comments

@dare05
Copy link

dare05 commented Nov 28, 2016

Here:

http://guides.rubyonrails.org/form_helpers.html

it writes:

The second argument to options_for_select must be exactly equal to the desired internal value. In particular if the value is the integer 2 you cannot pass "2" to options_for_select - you must pass 2. Be aware of values extracted from the params hash as they are all strings.

However, I tried doing exactly this in Rails 5 and it worked. So you might want to remove this or specify it applies for older versions of Rails.

@utilum
Copy link
Contributor

utilum commented Nov 28, 2016

This tip in the guides does date from 2009 (the birth of Rails guides?).
Perhaps we handle these better now?

@maclover7
Copy link
Contributor

@dare05 Would you be able to submit a PR to update the docs? Thanks!

@sgrif
Copy link
Contributor

sgrif commented Nov 30, 2016

Closing as there's no actionable bug here. Feel free to open a PR removing that warning if you wish, but it's not hurting anything if not.

@sgrif sgrif closed this as completed Nov 30, 2016
utilum added a commit to utilum/rails that referenced this issue Nov 30, 2016
maclover7 added a commit that referenced this issue Nov 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants