AJAX and select form help

Hi all,

Trying a different approach here. I’ve got a select box on the
(for ‘new’) like so:

<%= select(:schedule, :start_date, @dates) %>

When that date changes, I need it to pass the selected value to the
controller function (of the Schedule class), that looks like so:

def get_slots(date)
@slots = Schedule.get_available_slots(date)

Then I need another select box updated on the same (_form.rhtml) page:

<%= select(:schedule, :slot_number, @slots) %>

This can be in a partial if necessary.

How do I do this with with AJAX? I’ve tried following the examples, but
not doing so well.



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs