I’m building a calendar/scheduling application that has a bunch of
little pulldowns to let doctors note appointment status for a given
timeslot. I got the ajax call working with a submitbutton - but I
really want it to update the database as soon as a doctor selects a
new value for the appointment status.
<% remote_form_for(slot.get_todays_appointment do |f| %>
<%=h slot.get_todays_appointment.patient.first_last_name %>
<%= f.select :status, Appointment::STATUS_TYPES, :prompt => false %>
<%= submit_tag “Update” %>
<% end %>
I’ve tried to use an observer tied to the drop-down but that keeps
returning ‘null value’ and I’ve tried to use everything I can think
of for the identifier ‘appointment_status’ and ‘appointment[status]’.
Here’s the HTML that the above ruby code generates:
So what am I doing wrong? I just want to be able to have the form
submit onChange rather than having someone have to click a button.