Sha256: e6ad13a0c0e8d5b5e20529705045e6adcb8db23799e023e5ff9f5a5b65d13408
Contents?: true
Size: 864 Bytes
Versions: 7
Compression:
Stored size: 864 Bytes
Contents
module Puffer module Controller module Mutate def self.included base base.class_eval do extend ClassMethods include InstanceMethods layout 'puffer' helper :puffer helper_method :puffer?, :namespace end end module InstanceMethods def puffer? self.class.puffer? end def namespace self.class.namespace end end module ClassMethods def puffer? true end def namespace to_s.underscore.split('/').first end def model_name @model_name ||= (configuration.model_name || controller_name.singularize).to_s end def model @model ||= model_name.camelize.constantize rescue nil end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems