This is my first time serializing. I serialized an array of checkboxes w/ jQuery on the client side, put it into a hidden element, and submitted the form. Now on the server side I want to deserialize into an array I can use. Here is my string on the client side.
someArray%5B%5D=value0&someArray%5B%5D=value1
In Rails 3, I would like to get an array that looks like:
["value0", "value1"]
Thanks!
For serialization i came up with something and i’ve got working in production for a while.
Lets say i’ve got a Car model with 3 different type of gadgets. (Lets assume i dont want 3 fields in DB):
in your database must be a field named gadgets as TEXT (ths is very important)
in Car.rb
in your _form.rb
I hope you dont have to search by these fields later…