I am using a select menu to allow people to pick an item and be taken to a new page containing that item''s data. Pretty straightforward stuff. Except that I cannot quite figure out how to do this in Rails. I do not understand how to grab the variable from the select menu. Any suggestions? -- Posted via http://www.ruby-forum.com/.
Hi Ricardo, Ricardo ricardito>I am using a select menu to allow people to pick > an item and be taken to a new page containing that > item''s data. Pretty straightforward stuff. Except that > I cannot quite figure out how to do this in Rails. > > I do not understand how to grab the variable from the > select menu.It comes to the controller action in the params hash when the form''s submitted, just like a text_field''s value does. Nothing special. hth, Bill
> I do not understand how to grab the variable from the select menu.model from this example <select name = "object[dataField]"> <option selected> PLEASE CHOOSE DATAFIELD <% @objects.each do |object| %> <option value = "<%= @object.id %>" > <%= @object.dataField %> </option> <%end%> </select> -- Posted via http://www.ruby-forum.com/.