collection_radio_buttons

collection_radio_buttons(method, collection, value_method, text_method, options = {}, html_options = {}, &block) Instance Public methods Wraps ActionView::Helpers::FormOptionsHelper#collection_radio_buttons for form builders: <%= form_for @post do |f| %> <%= f.collection_radio_buttons :author_id, Author.all, :id, :name_with_initial %> <%= f.submit %> <% end %> Please refer to the documentation of the base helper for details.

collection_check_boxes

collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block) Instance Public methods Wraps ActionView::Helpers::FormOptionsHelper#collection_check_boxes for form builders: <%= form_for @post do |f| %> <%= f.collection_check_boxes :author_ids, Author.all, :id, :name_with_initial %> <%= f.submit %> <% end %> Please refer to the documentation of the base helper for details.

check_box

check_box(method, options = {}, checked_value = "1", unchecked_value = "0") Instance Public methods Returns a checkbox tag tailored for accessing a specified attribute (identified by method) on an object assigned to the template (identified by object). This object must be an instance object (@object) and not a local object. It's intended that method returns an integer and if that integer is above zero, then the checkbox is checked. Additional options on the input tag can be passed

button

button(value = nil, options = {}, &block) Instance Public methods Add the submit button for the given form. When no value is given, it checks if the object is a new resource or not to create the proper label: <%= form_for @post do |f| %> <%= f.button %> <% end %> In the example above, if @post is a new record, it will use âCreate Postâ as button label, otherwise, it uses âUpdate Postâ. Those labels can be customized using I18n, under the helpers.submit key (

new

new(object_name, object, template, options) Class Public methods

_to_partial_path

_to_partial_path() Class Public methods

debug

debug(object) Instance Public methods Returns a YAML representation of object wrapped with <pre> and </pre>. If the object cannot be converted to YAML using to_yaml, inspect will be called instead. Useful for inspecting an object at the time of rendering. @user = User.new({ username: 'testing', password: 'xyz', age: 42}) %> debug(@user) # => <pre class='debug_dump'>--- !ruby/object:User attributes: &nbsp; updated_at: &nbsp; username: testing &nb

time_tag

time_tag(date_or_time, *args, &block) Instance Public methods Returns an html time tag for the given date or time. time_tag Date.today # => <time datetime="2010-11-04">November 04, 2010</time> time_tag Time.now # => <time datetime="2010-11-04T17:55:45+01:00">November 04, 2010 17:55</time> time_tag Date.yesterday, 'Yesterday' # => <time datetime="2010-11-03">Yesterday</time> time_tag Date.today, pubdate: true # => <t

time_select

time_select(object_name, method, options = {}, html_options = {}) Instance Public methods Returns a set of select tags (one for hour, minute and optionally second) pre-selected for accessing a specified time-based attribute (identified by method) on an object assigned to the template (identified by object). You can include the seconds with :include_seconds. You can get hours in the AM/PM format with :ampm option. This method will also generate 3 input hidden tags, for the actual ye

time_ago_in_words

time_ago_in_words(from_time, include_seconds_or_options = {}) Instance Public methods Like distance_of_time_in_words, but where to_time is fixed to Time.now. time_ago_in_words(3.minutes.from_now) # => 3 minutes time_ago_in_words(3.minutes.ago) # => 3 minutes time_ago_in_words(Time.now - 15.hours) # => about 15 hours time_ago_in_words(Time.now) # => less than a minute time_ago_in_words(Time.now