Sha256: d07b6b9b554fb941946eb999895600dbaa1e649ba974a77037d29fc0baebc62c
Contents?: true
Size: 1.07 KB
Versions: 8
Compression:
Stored size: 1.07 KB
Contents
module Fennec module ActionViewExtension extend ActiveSupport::Concern module InstanceMethods # A helper that set the i18n columns def translate_attribute(klass, attribute_name) klass.human_attribute_name(attribute_name) end alias :ta :translate_attribute # A helper that renders the sec navigation highlight 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) content_tag(:li, content, options) end 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) content_tag(:li, content, options) end end end end ActionView::Base.send :include, Fennec::ActionViewExtension::InstanceMethods
Version data entries
8 entries across 8 versions & 1 rubygems