field_set_tag

field_set_tag(legend = nil, options = nil, &block)
Instance Public methods

Creates a field set for grouping HTML form elements.

legend will become the fieldset's title (optional as per W3C). options accept the same values as tag.

Examples

<%= field_set_tag do %>
  <p><%= text_field_tag 'name' %></p>
<% end %>
# => <fieldset><p><input id="name" name="name" type="text" /></p></fieldset>

<%= field_set_tag 'Your details' do %>
  <p><%= text_field_tag 'name' %></p>
<% end %>
# => <fieldset><legend>Your details</legend><p><input id="name" name="name" type="text" /></p></fieldset>

<%= field_set_tag nil, class: 'format' do %>
  <p><%= text_field_tag 'name' %></p>
<% end %>
# => <fieldset class="format"><p><input id="name" name="name" type="text" /></p></fieldset>
doc_ruby_on_rails
2015-06-20 00:00:00
Comments
Leave a Comment

Please login to continue.