Module: Fennec::ActionViewExtension::InstanceMethods

Defined in:
lib/fennec/helpers/action_view_extension.rb

Instance Method Summary collapse

Instance Method Details

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, options = {}, &block)
  if @main_nav == name
    if options[:class]
      options[:class] += " active"
    else
      options[:class] = "active"
    end
  end
  content = capture(&block)
  (:li, content, options)
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, options = {}, &block)
  if @sec_nav == name
    if options[:class]
      options[:class] += " active"
    else
      options[:class] = "active"
    end
  end
  content = capture(&block)
  (:li, content, options)
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