Module: Fennec::ActionViewExtension::InstanceMethods
- Defined in:
- lib/fennec/helpers/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
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fennec/helpers/action_view_extension.rb', line 13 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
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fennec/helpers/action_view_extension.rb', line 25 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
7 8 9 |
# File 'lib/fennec/helpers/action_view_extension.rb', line 7 def translate_attribute(klass, attribute_name) klass.human_attribute_name(attribute_name) end |