Monday, November 2, 2009

[Rails] How to get value of select box for button_to?

Hi,
I have a select box with the following options:
<select id="flight_destination" name="flight[destination]">
<option value="">Destination</option>
<optgroup label="Australia">
<option value="OOL">GoldCoast</option>
<option value="MEL">Melbourne</option>
</optgroup>
</select>

How do I get the value of the select box into the button_to?
<%= button_to "Search", {:controller =>
"ticket", :action=>"search", :depart=>"KUL", :arrival=>????} %>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate