method
label_tag
v8.0.0 -
Show latest stable
- Class:
ActionView::Helpers::FormTagHelper
label_tag(name = nil, content_or_options = nil, options = nil, &block)public
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>
2Notes
unobstrusive label tag
just use
label_tag('a_a','a_a')
and it works, just not ment for pure decorative labels :)
removes underscores -> do not use for images etc
example #does not work label_tag('aa'+image_tag('x_x.gif'))