Help with drop_receiving_element helper

I have an application that has a list of patient names and then a grid
representing appointment slots (time).

Each patient has a unique ID and draggable_element tag:

   <%= draggable_element "#{}", :revert => true %>

Then every "slot" in my grid is a droppable element:

  <%= drop_receiving_element "slot_#{}", :hoverclass =>
              :url => { :action => "add_appointment" } %>

Now so far it all works okay - excepting I don't get a critical piece
of information -- what is the DOM ID of the drop element. When I drag
and drop I get this in the console:

Processing CalendarController#add_appointment (for at
2008-05-27 16:46:46) [POST]
  Session ID: b958c16b06868fdaa74450b07b0dc339
"action"=>"add_appointment", "id"=>"378", "controller"=>"calendar"}

The ID is that of the patient I dropped on the slotbox -- but which
slot box?! Anyone know how I would pass both the slotbox ID along
with the patient ID? I need both to successfully create an

You need to include the slot receiving id in the remote call, so
either include it in your url:

  :url=>{:action=>'add_appointment', :slot_id=>}

or if you want finer control, use the :onDrop callback instead of :url
(see for all
the options)
and have a javascript function take care of the drop action. e.g.

:onDrop => " function(element){update_slot('#{}',element)}")

and then your update_slot function could parse the id from the
droppable element id,
and call an Ajax.Request with whatever parameters you want, including

or you could just add the slot_id to the :with option:

:with=> "'id=' + encodeURIComponent({}"

Thanks, I used the first method you explained and that did the trick.
Weird, because I had though I had tried that approach -- oh well.
It's working now though, so I'm happy!

Thank you!