number_field

number_field(object_name, method, options = {}) Instance Public methods Returns an input tag of type ânumberâ. Options Accepts same options as number_field_tag

month_field

month_field(object_name, method, options = {}) Instance Public methods Returns a #text_field of type âmonthâ. month_field("user", "born_on") # => <input id="user_born_on" name="user[born_on]" type="month" /> The default value is generated by trying to call strftime with â%Y-%mâ 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, 27) month_field("user", "born_on") # => <

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

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

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: <

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

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

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" />

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

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