diff options
author | Andrew Olson <anolson@gmail.com> | 2011-09-02 12:02:14 -0400 |
---|---|---|
committer | Andrew Olson <anolson@gmail.com> | 2011-09-02 12:02:14 -0400 |
commit | 57847fbfaf284d014274af6e6e70840472c43989 (patch) | |
tree | 7510c2159854f84da60ae70a39ccd2fbd4714328 /railties/guides/source/form_helpers.textile | |
parent | 3a7c16dbb9c1a4ea96c516c0a9f9ce5d34cee49a (diff) | |
parent | d20281add192e5afba66e555ce67cf73943b033b (diff) | |
download | rails-57847fbfaf284d014274af6e6e70840472c43989.tar.gz rails-57847fbfaf284d014274af6e6e70840472c43989.tar.bz2 rails-57847fbfaf284d014274af6e6e70840472c43989.zip |
Merge branch 'fix_validation_errors'
Diffstat (limited to 'railties/guides/source/form_helpers.textile')
-rw-r--r-- | railties/guides/source/form_helpers.textile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/guides/source/form_helpers.textile b/railties/guides/source/form_helpers.textile index c277f5723a..9b35c409b3 100644 --- a/railties/guides/source/form_helpers.textile +++ b/railties/guides/source/form_helpers.textile @@ -98,7 +98,7 @@ form_tag({:controller => "people", :action => "search"}, :method => "get", :clas h4. Helpers for Generating Form Elements -Rails provides a series of helpers for generating form elements such as checkboxes, text fields, and radio buttons. These basic helpers, with names ending in "_tag" (such as +text_field_tag+ and +check_box_tag+), generate just a single +<input>+ element. The first parameter to these is always the name of the input. When the form is submitted, the name will be passed along with the form data, and will make its way to the +params+ hash in the controller with the value entered by the user for that field. For example, if the form contains +<%= text_field_tag(:query) %>+, then you would be able to get the value of this field in the controller with +params[:query]+. +Rails provides a series of helpers for generating form elements such as checkboxes, text fields, and radio buttons. These basic helpers, with names ending in "_tag" (such as +text_field_tag+ and +check_box_tag+), generate just a single +<input>+ element. The first parameter to these is always the name of the input. When the form is submitted, the name will be passed along with the form data, and will make its way to the +params+ hash in the controller with the value entered by the user for that field. For example, if the form contains +<%= text_field_tag(:query) %>+, then you would be able to get the value of this field in the controller with +params[:query]+. When naming inputs, Rails uses certain conventions that make it possible to submit parameters with non-scalar values such as arrays or hashes, which will also be accessible in +params+. You can read more about them in "chapter 7 of this guide":#understanding-parameter-naming-conventions. For details on the precise usage of these helpers, please refer to the "API documentation":http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html. |