Improve the documentation of input_field helper

This commit is contained in:
Rafael Mendonça França 2011-04-19 15:23:24 -03:00
parent 671987b660
commit 2700b1316c
1 changed files with 6 additions and 1 deletions

View File

@ -91,7 +91,7 @@ module SimpleForm
end
alias :attribute :input
# Helper for outputting only the input tag, no wrapper, errors, label etc
# Creates a input tag for the given attribute.
#
# == Examples
#
@ -99,6 +99,11 @@ module SimpleForm
# f.input_field :name
# end
#
# This is the output html (only the input portion, not the form):
#
# <input class="string required" id="user_name" maxlength="100"
# name="user[name]" size="100" type="text" value="Carlos" />
#
def input_field(attribute_name, options={})
options.merge!({:components => [:input], :wrapper => false})
input(attribute_name, options)