Module: YMDP::FormTagHelper
- Included in:
- Compiler::Template::View
- Defined in:
- lib/ymdp/view/asset_tag_helper.rb
Instance Method Summary collapse
- #label(name, content_or_options = nil, options = {}) ⇒ Object
- #password_field(name, options = {}) ⇒ Object
- #text_field(name, options = {}) ⇒ Object
Instance Method Details
#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, = nil, = {}) if .is_a?(Hash) = text = name else text = || name end [:id] ||= "#{name.downcase}_label" [:for] ||= name.downcase content_tag("label", text, ) end |
#password_field(name, options = {}) ⇒ Object
43 44 45 46 |
# File 'lib/ymdp/view/asset_tag_helper.rb', line 43 def password_field(name, ={}) [:type] = "password" text_field(name, ) end |
#text_field(name, options = {}) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/ymdp/view/asset_tag_helper.rb', line 35 def text_field(name, ={}) [:id] ||= name [:name] ||= name [:type] ||= "text" tag("input", ) end |