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

Fixed ActionView::FormOptionsHelper#select with :multiple => false #1927

Merged
merged 1 commit into from Jul 1, 2011
Merged

Fixed ActionView::FormOptionsHelper#select with :multiple => false #1927

merged 1 commit into from Jul 1, 2011

Conversation

bogdan
Copy link
Contributor

@bogdan bogdan commented Jul 1, 2011

The following code:

select :post, :category_ids, [], {}, :multiple => false

Generates the select with name post[category_id][]. This is kinda confusing to add [] in case of false and nil for multiple attribute.

In real example with conditional multiple key we need the following:

select ..., {:class => "gg").merge(my_condition ? {:multiple => true}, {})

That is not very natural. So fixed default name to add [] only when :multiple looks truly.

josevalim added a commit that referenced this pull request Jul 1, 2011
Fixed ActionView::FormOptionsHelper#select with :multiple => false
@josevalim josevalim merged commit b31ce90 into rails:master Jul 1, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants