diff options
author | claudiob <claudiob@gmail.com> | 2014-11-20 10:48:29 -0800 |
---|---|---|
committer | claudiob <claudiob@gmail.com> | 2014-11-20 12:39:58 -0800 |
commit | 753600b240ba6cfebaac1662f4e216bf6c399023 (patch) | |
tree | c92c9d363f75d838ecb4b8221fe66300511a6682 /actionview/lib/action_view/test_case.rb | |
parent | b0f44c9ff0be84ebc42760029adeeb9dd954655f (diff) | |
download | rails-753600b240ba6cfebaac1662f4e216bf6c399023.tar.gz rails-753600b240ba6cfebaac1662f4e216bf6c399023.tar.bz2 rails-753600b240ba6cfebaac1662f4e216bf6c399023.zip |
Document *all* the options accepted by form_for
The [current documentation of form_for](http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_for) is incomplete:
> The rightmost argument to form_for is an optional hash of options -
> :url - The URL the form is to be submitted to. This may be represented in the same way as values passed to url_for or link_to. So for example you may use a named route directly. When the model is represented by a string or symbol, as in the example above, if the :url option is not specified, by default the form will be sent back to the current url (We will describe below an alternative resource-oriented usage of form_for in which the URL does not need to be specified explicitly).
> :namespace - A namespace for your form to ensure uniqueness of id attributes on form elements. The namespace attribute will be prefixed with underscore on the generated HTML id.
> :html - Optional HTML attributes for the form tag.
This commit completes the documentation by specifying that:
* `:authenticity_token` is also a valid option (as [documented here](https://github.com/rails/rails/blob/b0f44c9ff0be84ebc42760029adeeb9dd954655f/actionview/lib/action_view/helpers/form_helper.rb#L396))
* `:method` is also a valid option (as [tested here](https://github.com/rails/rails/blob/b0f44c9ff0be84ebc42760029adeeb9dd954655f/actionview/test/template/form_helper_test.rb#L1819))
* `:remote` is also a valid option (as [tested here](https://github.com/rails/rails/blob/b0f44c9ff0be84ebc42760029adeeb9dd954655f/actionview/test/template/form_helper_test.rb#L1850))
[ci skip]
Diffstat (limited to 'actionview/lib/action_view/test_case.rb')
0 files changed, 0 insertions, 0 deletions