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