Module: Refinery::ApplicationController::ClassMethods

Defined in:
lib/refinery/application_controller.rb

Class Method Summary collapse

Class Method Details

.included(c) ⇒ Object

Extend controller



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/refinery/application_controller.rb', line 18

def self.included(c) # Extend controller
  c.helper_method :home_page?,
                  :local_request?,
                  :just_installed?,
                  :from_dialog?,
                  :admin?,
                  :login?

  c.protect_from_forgery # See ActionController::RequestForgeryProtection

  c.send :include, Crud # basic create, read, update and delete methods

  c.send :before_filter, :find_pages_for_menu,
                         :show_welcome_page?

  c.send :after_filter, :store_current_location!,
                        :if => Proc.new {|c| c.send(:refinery_user?) rescue false }

  if Refinery.rescue_not_found
    c.send :rescue_from, ActiveRecord::RecordNotFound,
                         ActionController::UnknownAction,
                         ActionView::MissingTemplate,
                         :with => :error_404
  end
end