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>
doc_ruby_on_rails
2015-06-20 00:00:00
Comments
Leave a Comment

Please login to continue.