Whenever I work with forms in rails, I get so confused. The API documentation is not really clear regarding how to set a name for the form. There are other places that I get confused, but I will solve one problem at a time. The form_tag takes three arguments.
- The first argument is the url or action, and you can use the url_for syntax. This can be a string or a hash.
- The html options go into the second argument. This is where I would add a name option. It should be inside a hash.
- You can put more options in the third argument. This will be a hash.
This is what you would use for use in rails…
~~~ruby <% form_for ({:action => “update”, :id => @user}, {:name => “myForm” }, {}) do -%>
...
<% end %> ~~~
The output should look like this…
~~~html
~~~