class SimpleForm::FormBuilder
def input(attribute_name, options={}, &block)
given SimpleForm.time_zone_priority and SimpleForm.country_priority are used respectivelly.
Some inputs, as :time_zone and :country accepts a :priority option. If none is
== Priority
:value_method => the method to apply on the array collection to get the value
:label_method => the method to apply on the array collection to get the label
:collection => use to determine the collection to generate the radio or select
inputs), you have three extra options:
When playing with collections (:radio_buttons, :check_boxes and :select
== Collection
f.input :created_at, :include_blank => true
prompt and/or include blank. Such options are given in plainly:
Some inputs, as datetime, time and select allow you to give extra options, like
== Options
input html, supply :input_html instead and so on.
the label html you just need to give a hash to :label_html. To configure the
Besides the html for any component can be changed. So, if you want to change
:hint => false. The same works for :error, :label and :wrapper.
So, for instance, if you need to disable :hint for a given input, you can pass
The fact SimpleForm is built in components allow the interface to be unified.
by default.
:required => defines whether this attribute is required or not. True
can use it to generate a text field for a date column.
:as => allows you to define the input type you want, for instance you
You have some options for the input to enable/disable some functions:
heuristic to determine which is the best option.
Each database type will render a default input, based on some mappings and
can't be blank
My hint
name="user[name]" size="100" type="text" value="Carlos" />
* Super User Name!
def input(attribute_name, options={}, &block) options = @defaults.deep_dup.deep_merge(options) if @defaults chosen = if name = options[:wrapper] name.respond_to?(:render) ? name : SimpleForm.wrapper(name) else wrapper end chosen.render find_input(attribute_name, options, &block) end