I have a list of items on a page. Each item has a select list. If
someone changes the select list I would like to update the appropriate
record on the server…nothing else. I suspect I am making this too
I have an action on my controller for updating this value. I just
tried the ‘remote_function’, ah, function. It invokes the action on
the controller but the the value of the select that it is connected to
is not sent.
I hope I am missing something simple.
The controller action is:
goal = Goal.find(params[:id])
goal.status = params[:goal][:status]
The relevant form part looks like this
<%= select_tag(‘goal[status]’, options_for_select(GoalStatus::STATES,
goal.status), :onfiltered=> remote_function(:url =>
:update_status, :id => goal })) %>
Asked another way, how can I send the value of the form element
associated with the remote_function?
Is there a better way to do this?