Sha256: d1caf8fadf31c0428d7ecb329b30276168e858b130c4bf17609a76c029670f04
Contents?: true
Size: 650 Bytes
Versions: 26
Compression:
Stored size: 650 Bytes
Contents
module Locomotive module ActionController module SectionHelpers extend ActiveSupport::Concern def sections(key = nil) if !key.nil? && key.to_sym == :sub @locomotive_sections[:sub] || self.controller_name.dasherize else @locomotive_sections[:main] end end module ClassMethods def sections(main, sub = nil) before_filter do |c| sub = sub.call(c) if sub.respond_to?(:call) sections = { main: main, sub: sub } c.instance_variable_set(:@locomotive_sections, sections) end end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems