Select/drop-down menu

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?

On 9/19/06, Richard [email protected] 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’} %>

First Option Second Option <%= form_end_tag %>

and

class Somecontroller
def some_action
value = params[:my_select_box]
end
end

Cheers,
Max

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs