Formatting form post to work with[:my_class])


In my html page I have a simple (non rails generated) html for that posts to the server via an ajax call using prototype's form.serialize. It used to post to an page, but now I want it to post to my rails controller. This is what I have:

@my_class =[:my_class])

I don't want to have to set each property of MyClass one-by-one, I want to do what the above code shows. I want to pass all the necessary values to the MyClass constructor.

How can I translate my html form values to do this?

For it do do this your form inputs need to be named


Then it will work like you want. If you can’t have everything named like that, you’ll need to do it manually.



Ahhh, that you for showing me the scheme. Where is this documented?

It is documented indirectly here