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

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

week_field

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

collection_check_boxes

collection_check_boxes(object, method, collection, value_method, text_method, options = {}, html_options = {}, &block) Instance Public methods Returns check box tags for the collection of existing return values of method for object's class. The value returned from calling method on the instance object will be selected. If calling method returns nil, no selection is made. The :value_method and :text_method parameters are methods to be called on each member of collection. The ret

collection_radio_buttons

collection_radio_buttons(object, method, collection, value_method, text_method, options = {}, html_options = {}, &block) Instance Public methods Returns radio button tags for the collection of existing return values of method for object's class. The value returned from calling method on the instance object will be selected. If calling method returns nil, no selection is made. The :value_method and :text_method parameters are methods to be called on each member of collection. Th

collection_select

collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {}) Instance Public methods Returns <select> and <option> tags for the collection of existing return values of method for object's class. The value returned from calling method on the instance object will be selected. If calling method returns nil, no selection is made without including :prompt or :include_blank in the options hash. The :value_method and :text_method pa

grouped_collection_select

grouped_collection_select(object, method, collection, group_method, group_label_method, option_key_method, option_value_method, options = {}, html_options = {}) Instance Public methods Returns <select>, <optgroup> and <option> tags for the collection of existing return values of method for object's class. The value returned from calling method on the instance object will be selected. If calling method returns nil, no selection is made without including :prompt or

grouped_options_for_select

grouped_options_for_select(grouped_options, selected_key = nil, options = {}) Instance Public methods Returns a string of <option> tags, like options_for_select, but wraps them with <optgroup> tags: grouped_options = [ ['North America', [['United States','US'],'Canada']], ['Europe', ['Denmark','Germany','France']] ] grouped_options_for_select(grouped_options) grouped_options = { 'North America' => [['United States','US'], 'Canada'], 'Europe' => ['Denm

option_groups_from_collection_for_select

option_groups_from_collection_for_select(collection, group_method, group_label_method, option_key_method, option_value_method, selected_key = nil) Instance Public methods Returns a string of <option> tags, like options_from_collection_for_select, but groups them by <optgroup> tags based on the object relationships of the arguments. Parameters: collection - An array of objects representing the <optgroup> tags. group_method - The name of a method which, when call

options_for_select

options_for_select(container, selected = nil) Instance Public methods Accepts a container (hash, array, enumerable, your type) and returns a string of option tags. Given a container where the elements respond to first and last (such as a two-element array), the âlastsâ serve as option values and the âfirstsâ as option text. Hashes are turned into this form automatically, so the keys become âfirstsâ and values become lasts. If selected is specified, the matching âlastâ or element wi