Sha256: 867b80f4bccf3f59f5bade6d78560c6a6033ec36b0a8c53521f9aba5f969f5f3
Contents?: true
Size: 796 Bytes
Versions: 19
Compression:
Stored size: 796 Bytes
Contents
module Leather module ActionControllerExtension extend ActiveSupport::Concern included do extend ClassMethods helper_method :current_tab, :current_tab? end protected def set_tab(name, namespace = nil) tab_stack[namespace || :default] = name end def current_tab(namespace = nil) tab_stack[namespace || :default] end def current_tab?(name, namespace = nil) current_tab(namespace).to_s == name.to_s end def tab_stack @tab_stack ||= {} end module ClassMethods def set_tab(*args) options = args.extract_options! name, namespace = args before_filter(options) do |controller| controller.send(:set_tab, name, namespace) end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems