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") # => <

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

password_field

password_field(object_name, method, options = {}) Instance Public methods Returns an input tag of the âpasswordâ type 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. For security reasons this field is blank by default; pass in a valu

phone_field

phone_field(object_name, method, options = {}) Instance Public methods aliases #telephone_field telephone_field

radio_button

radio_button(object_name, method, tag_value, options = {}) Instance Public methods Returns a radio button tag for accessing a specified attribute (identified by method) on an object assigned to the template (identified by object). If the current value of method is tag_value the radio button will be checked. To force the radio button to be checked pass checked: true in the options hash. You may pass HTML options there as well. # Let's say that @post.category returns "rails": radio_b

range_field

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

search_field

search_field(object_name, method, options = {}) Instance Public methods Returns an input of type âsearchâ for accessing a specified attribute (identified by method) on an object assigned to the template (identified by object_name). Inputs of type âsearchâ may be styled differently by some browsers. search_field(:user, :name) # => <input id="user_name" name="user[name]" type="search" /> search_field(:user, :name, autosave: false) # => <input autosave="false" id="user_

telephone_field

telephone_field(object_name, method, options = {}) Instance Public methods Returns a #text_field of type âtelâ. telephone_field("user", "phone") # => <input id="user_phone" name="user[phone]" type="tel" /> phone_field

text_area

text_area(object_name, method, options = {}) Instance Public methods Returns a textarea opening and closing tag set 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. Examples text_area(:post, :body, cols: 20, rows: 40) # => <textarea cols="20" rows="40" id="post_body" name="post[body]"> # #{@post.body} # </text

text_field

text_field(object_name, method, options = {}) Instance Public methods Returns an input tag of the âtextâ type 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 text_field(:post, :title, size: 20) # => <input type="text"