Forum: Ruby on Rails Select Lists

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
57d2594584b9c4e2b6fb2059968b3d84?d=identicon&s=25 John (Guest)
on 2006-04-30 20:42
Is there any way to trigger a controller action when the user picks an
option from a selection list?
C62eb10afff640cb0fa31cfaa07f6715?d=identicon&s=25 Davy Campano (Guest)
on 2006-05-03 18:56
(Received via mailing 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
selection
box as a GET parameter.
This topic is locked and can not be replied to.