Sha256: e4590397b23f712ba1cd68b4d0dcb7b387b57875900214fbb5e302cdcdda4d6f

Contents?: true

Size: 597 Bytes

Versions: 3

Compression:

Stored size: 597 Bytes

Contents

module Databaseformalizer
  ## Define ControllerMethods
  module Controller
  	## this one manages the usual self.included, klass_eval stuff
    extend ActiveSupport::Concern
  	included do
      before_filter :set_special_layout_databaseformalizer
    end
    
    def set_special_layout_databaseformalizer
      module_name = self.class.name.split("::").first
      if module_name == 'Databaseformalizer'
        self.class.layout "databaseformalizer/layouts/application"
      end
    end

  end
end
::ActionController::Base.send :include, Databaseformalizer::Controller


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
databaseformalizer-1.0.1 lib/application_controller.rb
databaseformalizer-1.0 lib/application_controller.rb
databaseformalizer-0.3.0 lib/application_controller.rb