options_from_collection_for_select

options_from_collection_for_select(collection, value_method, text_method, selected = nil) Instance Public methods Returns a string of option tags that have been compiled by iterating over the collection and assigning the result of a call to the value_method as the option value and the text_method as the option text. options_from_collection_for_select(@people, 'id', 'name') # => <option value="#{person.id}">#{person.name}</option> This is more often than not used ins

select

select(object, method, choices = nil, options = {}, html_options = {}, &block) Instance Public methods Create a select tag and a series of contained option tags for the provided object and method. The option currently held by the object will be selected, provided that the object is available. There are two possible formats for the choices parameter, corresponding to other helpers' output: A flat collection (see options_for_select). A nested collection (see grouped_options_fo

time_zone_options_for_select

time_zone_options_for_select(selected = nil, priority_zones = nil, model = ::ActiveSupport::TimeZone) Instance Public methods Returns a string of option tags for pretty much any time zone in the world. Supply a ActiveSupport::TimeZone name as selected to have it marked as the selected option tag. You can also supply an array of ActiveSupport::TimeZone objects as priority_zones, so that they will be listed above the rest of the (long) list. (You can use ActiveSupport::TimeZone.us_zo

time_zone_select

time_zone_select(object, method, priority_zones = nil, options = {}, html_options = {}) Instance Public methods Returns select and option tags for the given object and method, using time_zone_options_for_select to generate the list of option tags. In addition to the :include_blank option documented above, this method also supports a :model option, which defaults to ActiveSupport::TimeZone. This may be used by users to specify a different time zone model object. (See time_zone_optio

button_tag

button_tag(content_or_options = nil, options = nil, &block) Instance Public methods Creates a button element that defines a submit button, resetbutton or a generic button which can be used in JavaScript, for example. You can use the button tag as a regular submit tag but it isn't supported in legacy browsers. However, the button tag allows richer labels such as images and emphasis, so this helper will also accept a block. Options :data - This option can be used to add custom d

check_box_tag

check_box_tag(name, value = "1", checked = false, options = {}) Instance Public methods Creates a check box form input tag. Options :disabled - If set to true, the user will not be able to use this input. Any other key creates standard HTML options for the tag. Examples check_box_tag 'accept' # => <input id="accept" name="accept" type="checkbox" value="1" /> check_box_tag 'rock', 'rock music' # => <input id="rock" name="rock" type="checkbox" value="rock music"

color_field_tag

color_field_tag(name, value = nil, options = {}) Instance Public methods Creates a text field of type âcolorâ. Options Accepts the same options as text_field_tag.

date_field_tag

date_field_tag(name, value = nil, options = {}) Instance Public methods Creates a text field of type âdateâ. Options Accepts the same options as text_field_tag.

datetime_field_tag

datetime_field_tag(name, value = nil, options = {}) Instance Public methods Creates a text field of type âdatetimeâ. Options :min - The minimum acceptable value. :max - The maximum acceptable value. :step - The acceptable value granularity. Otherwise accepts the same options as text_field_tag.

datetime_local_field_tag

datetime_local_field_tag(name, value = nil, options = {}) Instance Public methods Creates a text field of type âdatetime-localâ. Options :min - The minimum acceptable value. :max - The maximum acceptable value. :step - The acceptable value granularity. Otherwise accepts the same options as text_field_tag.