Method: YMDP::FormTagHelper#label

Defined in:
lib/ymdp/view/asset_tag_helper.rb

#label(name, content_or_options = nil, options = {}) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/ymdp/view/asset_tag_helper.rb', line 48

def label(name, content_or_options = nil, options = {})
  if content_or_options.is_a?(Hash)
    options = content_or_options
    text = name
  else
    text = content_or_options || name
  end
  options[:id] ||= "#{name.downcase}_label"
  options[:for] ||= name.downcase
  ("label", text, options)
end