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.
John (Guest)
on 2006-04-30 22:42
Is there any way to trigger a controller action when the user picks an
option from a selection list?
Davy C. (Guest)
on 2006-05-03 20: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.