Sha256: 17f61b6d90f446f7f363d4abe13d2d5ee1238bc5e896b8c2b27a42af2f912668

Contents?: true

Size: 690 Bytes

Versions: 128

Compression:

Stored size: 690 Bytes

Contents

module ShareLayouts
  module Controllers
    module ActionController

      def self.included(base)
        base.extend ClassMethods
      end

      module ClassMethods
        def trusty_layout(name=nil, options={}, &block)
          raise ArgumentError, "A layout name or block is required!" unless name || block
          class_attribute :trusty_layout
          self.trusty_layout = name || block
          before_action :set_trusty_layout
          layout 'trusty', options
        end
      end

      def set_trusty_layout
        @trusty_layout = self.class.trusty_layout
        @trusty_layout = @trusty_layout.call(self) if @trusty_layout.is_a? Proc
      end

    end
  end
end

Version data entries

128 entries across 128 versions & 2 rubygems

Version Path
trusty-cms-7.0.10 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-7.0.9 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-7.0.8 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-7.0.7 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-7.0.6 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-7.0.5 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-7.0.4 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-7.0.3 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-6.3.1 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-7.0.2 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-7.0.1 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-7.0.0 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-6.3 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-6.2.1 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-6.2.2.1 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-6.2.0 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-6.1.2 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-6.1.1 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-6.0.5 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb
trusty-cms-6.0.4 vendor/extensions/layouts-extension/lib/share_layouts/controllers/action_controller.rb