method
label_tag
v2.1.0 -
Show latest stable
- Class:
ActionView::Helpers::FormTagHelper
label_tag(name, text = nil, options = {})public
Creates a label field
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>
3Notes
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'))
Html inside Lable tag
I need this