I have a sortable list that I serialize and pass to ruby to parse the
results and update my array of hashes.
eg.
$tasks = [
{ :id => 1, :name => 'Do the dishes', :position => 3 },
{ :id => 2, :name => 'Take out the trash', :position => 2 },
{ :id => 3, :name => 'Shovel the driveway', :position => 1 }
]
My hurdles:
(1) serializing and passing with Ajax
var list = Sortable.options('tasks').element;
new Ajax.Request('/tasks', { parameters: Sortable.serialize(list)});
I get this:
tasks%5B%5D=2&tasks%5B%5D=1&tasks%5B%5D=3
would it be more useful if It was formating it as such?
task{id}={position}&
Where are the %5B%5D coming from?
(2) parsing it in ruby
I grab the request with web brick and I pass the query to params
params = request.query
How do I go about parsing it and updating my array of hashes?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---