Module: Penmanship::ActionView::Extension::InstanceMethods
- Defined in:
- lib/penmanship/action_view/extension.rb
Instance Method Summary collapse
-
#main_nav(name, options = {}, &block) ⇒ Object
A helper that renders the sec navigation highlight.
- #sec_nav(name, options = {}, &block) ⇒ Object
-
#translate_attribute(klass, attribute_name) ⇒ Object
(also: #ta)
A helper that set the i18n columns.
Instance Method Details
#main_nav(name, options = {}, &block) ⇒ Object
A helper that renders the sec navigation highlight
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/penmanship/action_view/extension.rb', line 15 def main_nav(name, = {}, &block) if @main_nav == name if [:class] [:class] += " active" else [:class] = "active" end end content = capture(&block) content_tag(:li, content, ) end |
#sec_nav(name, options = {}, &block) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/penmanship/action_view/extension.rb', line 27 def sec_nav(name, = {}, &block) if @sec_nav == name if [:class] [:class] += " active" else [:class] = "active" end end content = capture(&block) content_tag(:li, content, ) end |
#translate_attribute(klass, attribute_name) ⇒ Object Also known as: ta
A helper that set the i18n columns
9 10 11 |
# File 'lib/penmanship/action_view/extension.rb', line 9 def translate_attribute(klass, attribute_name) klass.human_attribute_name(attribute_name) end |