Improve the documentation of input_field helper
This commit is contained in:
parent
671987b660
commit
2700b1316c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue