radio_button_tag

radio_button_tag(name, value, checked = false, options = {}) Instance Public methods Creates a radio button; use groups of radio buttons named the same to allow users to select from a group of options. 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 radio_button_tag 'gender', 'male' # => <input id="gender_male" name="gender" type="radio" value="male" /> radio_button_ta

phone_field_tag

phone_field_tag(name, value = nil, options = {}) Instance Public methods Alias for: telephone_field_tag

password_field_tag

password_field_tag(name = "password", value = nil, options = {}) Instance Public methods Creates a password field, a masked text field that will hide the users input behind a mask character. Options :disabled - If set to true, the user will not be able to use this input. :size - The number of visible characters that will fit in the input. :maxlength - The maximum number of characters that the browser will allow the user to enter. Any other key creates standard HTML attribute

number_field_tag

number_field_tag(name, value = nil, options = {}) Instance Public methods Creates a number field. Options :min - The minimum acceptable value. :max - The maximum acceptable value. :in - A range specifying the :min and :max values. :step - The acceptable value granularity. Otherwise accepts the same options as text_field_tag. Examples number_field_tag 'quantity', nil, in: 1...10 # => <input id="quantity" name="quantity" min="1" max="9" type="number" />

month_field_tag

month_field_tag(name, value = nil, options = {}) Instance Public methods Creates a text field of type âmonthâ. 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.

label_tag

label_tag(name = nil, content_or_options = nil, options = nil, &block) Instance Public methods Creates a label element. Accepts a block. Options Creates standard HTML attributes for the tag. Examples label_tag 'name' # => <label for="name">Name</label> label_tag 'name', 'Your name' # => <label for="name">Your name</label> label_tag 'name', nil, class: 'small_label' # => <label for="name" class="small_label">Name</label>

image_submit_tag

image_submit_tag(source, options = {}) Instance Public methods Displays an image which when clicked will submit the form. source is passed to ActionView::Helpers::AssetUrlHelper#path_to_image Options :data - This option can be used to add custom data attributes. :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. Data attributes confirm: 'question?' - This will add a JavaScript confirm prompt wit

hidden_field_tag

hidden_field_tag(name, value = nil, options = {}) Instance Public methods Creates a hidden form input field used to transmit data that would be lost due to HTTP's statelessness or data that should be hidden from the user. Options Creates standard HTML attributes for the tag. Examples hidden_field_tag 'tags_list' # => <input id="tags_list" name="tags_list" type="hidden" /> hidden_field_tag 'token', 'VUBJKB23UIVI1UU1VOBVI@' # => <input id="token" name="token" type=

form_tag

form_tag(url_for_options = {}, options = {}, &block) Instance Public methods Starts a form tag that points the action to an url configured with url_for_options just like ActionController::Base#url_for. The method for the form defaults to POST. Options :multipart - If set to true, the enctype is set to âmultipart/form-dataâ. :method - The method to use when submitting the form, usually either âgetâ or âpostâ. If âpatchâ, âputâ, âdeleteâ, or another verb is used, a hidden inpu

file_field_tag

file_field_tag(name, options = {}) Instance Public methods Creates a file upload field. If you are using file uploads then you will also need to set the multipart option for the form tag: <%= form_tag '/upload', multipart: true do %> <label for="file">File to Upload</label> <%= file_field_tag "file" %> <%= submit_tag %> <% end %> The specified URL will then be passed a File object containing the selected file, or if the field was left blank,