Permalink
Browse files

Added :placeholder option to ActionView::Helpers::FormTagHelper text_…

…field_tag
  • Loading branch information...
1 parent 8fdf531 commit becb0082233e1e1a689b725af0c8db1635b9fe1f @remear remear committed with fxn Dec 13, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -115,6 +115,7 @@ def select_tag(name, option_tags = nil, options = {})
# * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
# * <tt>:size</tt> - The number of visible characters that will fit in the input.
# * <tt>:maxlength</tt> - The maximum number of characters that the browser will allow the user to enter.
+ # * <tt>:placeholder</tt> - The text contained in the field by default which is removed when the field receives focus.
# * Any other key creates standard HTML attributes for the tag.
#
# ==== Examples
@@ -124,6 +125,9 @@ def select_tag(name, option_tags = nil, options = {})
# text_field_tag 'query', 'Enter your search query here'
# # => <input id="query" name="query" type="text" value="Enter your search query here" />
#
+ # text_field_tag 'search', nil, :placeholder => 'Enter search term...'
+ # # => <input id="search" name="search" placeholder="Enter search term..." type="text" />
+ #
# text_field_tag 'request', nil, :class => 'special_input'
# # => <input class="special_input" id="request" name="request" type="text" />
#

0 comments on commit becb008

Please sign in to comment.