color_field

color_field(object_name, method, options = {}) Instance Public methods Returns a #text_field of type âcolorâ. color_field("car", "color") # => <input id="car_color" name="car[color]" type="color" value="#000000" />

date_field

date_field(object_name, method, options = {}) Instance Public methods Returns a #text_field of type âdateâ. date_field("user", "born_on") # => <input id="user_born_on" name="user[born_on]" type="date" /> The default value is generated by trying to call âto_dateâ on the object's value, which makes it behave as expected for instances of DateTime and ActiveSupport::TimeWithZone. You can still override that by passing the âvalueâ option explicitly, e.g. @user.born_on = Date.n

datetime_field

datetime_field(object_name, method, options = {}) Instance Public methods Returns a #text_field of type âdatetimeâ. datetime_field("user", "born_on") # => <input id="user_born_on" name="user[born_on]" type="datetime" /> The default value is generated by trying to call strftime with â%Y-%m-%dT%T.%L%zâ on the object's value, which makes it behave as expected for instances of DateTime and ActiveSupport::TimeWithZone. @user.born_on = Date.new(1984, 1, 12) datetime_field("user

datetime_local_field

datetime_local_field(object_name, method, options = {}) Instance Public methods Returns a #text_field of type âdatetime-localâ. datetime_local_field("user", "born_on") # => <input id="user_born_on" name="user[born_on]" type="datetime-local" /> The default value is generated by trying to call strftime with â%Y-%m-%dT%Tâ on the object's value, which makes it behave as expected for instances of DateTime and ActiveSupport::TimeWithZone. @user.born_on = Date.new(1984, 1, 12) d

email_field

email_field(object_name, method, options = {}) Instance Public methods Returns a #text_field of type âemailâ. email_field("user", "address") # => <input id="user_address" name="user[address]" type="email" />

fields_for

fields_for(record_name, record_object = nil, options = {}, &block) Instance Public methods Creates a scope around a specific model object like #form_for, but doesn't create the form tags themselves. This makes #fields_for suitable for specifying additional model objects in the same form. Although the usage and purpose of field_for is similar to form_for's, its method signature is slightly different. Like form_for, it yields a FormBuilder object associated with a particular mode

file_field

file_field(object_name, method, options = {}) Instance Public methods Returns a file upload input tag tailored for accessing a specified attribute (identified by method) on an object assigned to the template (identified by object). Additional options on the input tag can be passed as a hash with options. These options will be tagged onto the HTML as an HTML element attribute as in the example shown. Using this method inside a form_for block will set the enclosing form's encoding to

form_for

form_for(record, options = {}, &block) Instance Public methods Creates a form that allows the user to create or update the attributes of a specific model object. The method can be used in several slightly different ways, depending on how much you wish to rely on Rails to infer automatically from the model how the form should be constructed. For a generic model object, a form can be created by passing form_for a string or symbol representing the object we are concerned with: <

hidden_field

hidden_field(object_name, method, options = {}) Instance Public methods Returns a hidden input tag tailored for accessing a specified attribute (identified by method) on an object assigned to the template (identified by object). Additional options on the input tag can be passed as a hash with options. These options will be tagged onto the HTML as an HTML element attribute as in the example shown. Examples hidden_field(:signup, :pass_confirm) # => <input type="hidden" id="sign

label

label(object_name, method, content_or_options = nil, options = nil, &block) Instance Public methods Returns a label tag tailored for labelling an input field for a specified attribute (identified by method) on an object assigned to the template (identified by object). The text of label will default to the attribute name unless a translation is found in the current I18n locale (through helpers.label.<modelname>.<attribute>) or you specify it explicitly. Additional op