Select Lists

Is there any way to trigger a controller action when the user picks an
option from a selection list?

Here’s one that I use:

<%= select(:order, :customer_id, @customers, {:include_blank => true},
{ :onchange => remote_function(:url => {:action => :get_address},
:complete => “eval(request.responseText)”, :with => “‘customer_id=’+
escape(value)”)}) %>

This triggers the get_address action and passes the value from the
box as a GET parameter.

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