This project is archived and is in readonly mode.

#3203 ✓invalid
Sam Woodard

select helper breaks for numerical values and displays

Reported by Sam Woodard | September 14th, 2009 @ 11:52 PM

If I have builder.select(:method, [1,2,3]) etc, I get
123

This is what I would expect. However if my_instance.method returns 2, the options with value, "2", does not get selected.

However if I do,

builder.select(:method, [1,2,3].collect{|e| [e, "a#{e}"]})

thus appending an 'a' before the value of each element, the behavior works as expected.

I think that the method should match on "2" == "2" and put out selected="selected" and not require an alpha character prefix.

Thanks in advance.

Sam

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Tags

Pages