Is there any reason you can't just use hidden fields with the name "item[]"? I think there is a similar conversion process in PHP, and as long as you don't use the name (and the []) for jQuery selection it shouldn't be a problem. I haven't used the item[]=xy => item[0]="xy" thing myself (ColdFusion doesn't have it) but I have used hidden fields in your sortable plugin as a way of controlling item order.

Blair

On 10/27/06, Yehuda Katz <[EMAIL PROTECTED]> wrote:
So I'm working on various Rails solutions using jQuery and Interface.

The way Rails/Prototype handles sortables is as follows:

You have a series of id's in a list: item_2, item_4, item_1, item_3, etc.

Prototype serializes as: item[]=2&item[]=4&item[]=1&item=3 etc.

Rails converts the serialized form into params[:item] = ["2","4","1","3"...]; in other words, a usable array.

This makes it really easy to convert the array into a list of positions for the database. It seems that there's no trivial way to do this with Interface without writing a custom serializer or having Rails deal with the identifier on the back end. Am I missing something?

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/



_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to