field_set_tag(legend = nil, &block) public

Creates a field set for grouping HTML form elements.

legend will become the fieldset’s title (optional as per W3C).

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>
Show source
Register or log in to add new notes.