I have a very weird behavior by Rails 3.2.
I use a form_tag in my haml page:
= form_tag messages_path, :method => :get do
this form contains some checkboxes
and this code works fine.
But I don’t like get.
If I substitute “get” with “post” something really weird happens:
It appears that the control goes to my “create” method, creates a nil object in my db and then goes back to the original page (that’s what I told the “create” method to do anyways).
Then, the checkboxes are pretty messed up…
Note: I save the checkbox contents in the session. Dunno, if it really matters.
Seems like “post” takes you to “create” by default ?? Can I change that ?
“Get” works fine but messes up my url….
any suggestions ???
Yes by default post maps the request to the create method of the controller.
If you want use post request add the below piece of code in config/routes.rb
In your messages controller
Then the form builder will be