url_field

url_field(object_name, method, options = {}) Instance Public methods Returns a #text_field of type âurlâ. url_field("user", "homepage") # => <input id="user_homepage" name="user[homepage]" type="url" />

time_field

time_field(object_name, method, options = {}) Instance Public methods Returns a #text_field of type âtimeâ. The default value is generated by trying to call strftime with â%T.%Lâ on the objects's value. It is still possible to override that by passing the âvalueâ option. Options Accepts same options as time_field_tag Example time_field("task", "started_at") # => <input id="task_started_at" name="task[started_at]" type="time" />

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"

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

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

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_

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

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

phone_field

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

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