On 9/19/06, Richard
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> I''m not sure how to create a select menu with multiple options
that when
> you choose one calls the same action as all the others but provides
> different parameters. Any ideas?
>
The value of the selected element will be passed as a form parameter:
<%= form_start_tag
:url=>{:controller=>''some_controller'',
:action=>''some_action''} %>
<select name="my_select_box">
<option value="1">First Option</option>
<option value="2">Second Option</option>
</select>
<%= form_end_tag %>
and
class Somecontroller
def some_action
value = params[:my_select_box]
end
end
Cheers,
Max
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---