I have two questions.
I have a select tag in a rails 3 application that looks like this:
<%= select(@adverse_event_template_settings,
"display_arms",
options_for_select([["Yes", true], ["No", false]]),
{ :selected => :display_arms },
:onchange => remote_function(:update => "display_arms",
:method => "put",
:with => "'display_arms=' + value",
:url => { :controller => :adverse_event_template_settings,
:action => :update, :id => @aets.id})) %>
This does what I want to do, i.e. invokes a controller action when the value of the selection field changes.
Despite the fact that this works, I want to know: 1) Is it really in rails 3? I know this is obsessive javascript, but the remote_function working in rails 3 seems strange to me - is there something wrong here?
and if the above is NOT valid, I really would like to know 2) how can I perform the same action (i.e., invoke the same action on the same controller) is unobtrusive? Is there a way to make this simple and clean on rails 3? I desperately need help coding this part.
!
, .