Module: DataMapper::Form::Labels
- Defined in:
- lib/dm-forms/mixins/labels.rb
Instance Method Summary collapse
- #label_tag(attrs = {}) ⇒ Object
- #self_closing_tag(name, attrs = {}) ⇒ Object
- #tag(name, contents = nil, attrs = {}, &block) ⇒ Object
Instance Method Details
#label_tag(attrs = {}) ⇒ Object
12 13 14 |
# File 'lib/dm-forms/mixins/labels.rb', line 12 def label_tag attrs = {} (label = attrs.delete(:label)) ? tag(:label, label, :for => attrs[:name]) : '' end |
#self_closing_tag(name, attrs = {}) ⇒ Object
8 9 10 |
# File 'lib/dm-forms/mixins/labels.rb', line 8 def self_closing_tag name, attrs = {} label_tag(attrs) + super end |
#tag(name, contents = nil, attrs = {}, &block) ⇒ Object
4 5 6 |
# File 'lib/dm-forms/mixins/labels.rb', line 4 def tag name, contents = nil, attrs = {}, &block label_tag(attrs) + super end |