on 2005-12-09 20:56
on 2005-12-09 23:55
on 2005-12-10 01:50
Thanks for the help forrest. You stated I could do "where => 'element1'" but how does Rails know it is a DOM object?
on 2005-12-10 02:02
Gray, Jeffrey <jeff.gray@...> writes: > > Thanks for the help forrest. You stated I could do "where => 'element1'" > but how does Rails know it is a DOM object? It doesn't know--when you feed ":where => 'element1'" to the url helper, all it knows is that you want to send an additional parameter called "where", with value "element1" as part of the URL, so you'd get a URL that looks something like: http://whatever.com/testcontroller/test?where=element1 It doesn't know "element1" is a DOM ID--it could be anything. The trick to this is that *you* know the DOM ID, and when you write the Rails code to create the drop receiving element, *you* can specify that ID as the value for the "where" parameter. If your web page has 3 different drop receiving elements, you write a drop_receiving_element helper for each one, and give each one a different "where" value, so that when the AJAX requests come in to it, it can tell the difference between them. This means that you don't have to use DOM IDs at all--you could use any unique identifiers that your action can tell apart. --Forrest
on 2005-12-10 15:34
Thanks again Forrest. However, I do not now the element ID...it is being produced by a sql query. But I know the parent id and child id...so I need to use JS to get the node. is this possible?
on 2005-12-10 18:18