views:

225

answers:

3

Hi All,

Is there an equivalent of "link_to_function" (instead of ":action") when using "draggable_element"? Basically I need to drag and drop some items and have it reflected locally without contacting the server.

My current setup is that I have two DIVs with various list items. I have one full of items with domids "points[selected][name]" and another div with domids "points[available][name]". I need to drag and drop between them without consulting the server. Only on save do I wish to bother the server.

I've watched all the RailsCasts on similar items, but it doesn't seem to cover having a non-standard action (i.e. Helper Function) triggered from a "draggable_element" method.

Thanks in advance!

A: 

nice question; I'm searching for something similar, too

ZCJ
A: 

Off the top of my head, can't you just omit the :action from the sortable_element call and include the new sort order when you submit your form?

Jeff Paquette
+1  A: 

From the top of my head I would say: don't use the helper that rails provides. Write your own JS to do the UI manipulation since you need a custom action.

Okay, not that helpfull, but I think it's the best way.

Mereghost