2009-06-15 14:44:45 -04:00
|
|
|
module ActionController
|
2009-08-06 18:50:22 -04:00
|
|
|
class Base < Metal
|
2009-06-15 14:44:45 -04:00
|
|
|
abstract!
|
|
|
|
|
2010-04-05 04:52:47 -04:00
|
|
|
def self.without_modules(*modules)
|
2010-04-05 00:06:26 -04:00
|
|
|
modules = modules.map do |m|
|
|
|
|
m.is_a?(Symbol) ? ActionController.const_get(m) : m
|
|
|
|
end
|
2009-06-15 14:44:45 -04:00
|
|
|
|
2010-04-05 00:06:26 -04:00
|
|
|
MODULES - modules
|
|
|
|
end
|
2010-04-04 23:09:03 -04:00
|
|
|
|
2010-04-05 00:06:26 -04:00
|
|
|
MODULES = [
|
|
|
|
AbstractController::Layouts,
|
|
|
|
AbstractController::Translation,
|
2009-06-15 14:44:45 -04:00
|
|
|
|
2010-04-05 00:06:26 -04:00
|
|
|
Helpers,
|
|
|
|
HideActions,
|
|
|
|
UrlFor,
|
|
|
|
Redirecting,
|
|
|
|
Rendering,
|
|
|
|
Renderers::All,
|
|
|
|
ConditionalGet,
|
|
|
|
RackDelegation,
|
|
|
|
SessionManagement,
|
|
|
|
Caching,
|
|
|
|
MimeResponds,
|
|
|
|
PolymorphicRoutes,
|
|
|
|
ImplicitRender,
|
2009-06-15 14:44:45 -04:00
|
|
|
|
2010-04-05 00:06:26 -04:00
|
|
|
Cookies,
|
|
|
|
Flash,
|
|
|
|
RequestForgeryProtection,
|
|
|
|
Streaming,
|
|
|
|
RecordIdentifier,
|
|
|
|
HttpAuthentication::Basic::ControllerMethods,
|
|
|
|
HttpAuthentication::Digest::ControllerMethods,
|
2010-04-30 10:46:30 -04:00
|
|
|
HttpAuthentication::Token::ControllerMethods,
|
2009-06-15 14:44:45 -04:00
|
|
|
|
2010-04-05 00:06:26 -04:00
|
|
|
# Add instrumentations hooks at the bottom, to ensure they instrument
|
|
|
|
# all the methods properly.
|
|
|
|
Instrumentation,
|
2009-06-15 14:44:45 -04:00
|
|
|
|
2010-04-05 00:06:26 -04:00
|
|
|
# Before callbacks should also be executed the earliest as possible, so
|
|
|
|
# also include them at the bottom.
|
|
|
|
AbstractController::Callbacks,
|
2008-12-25 15:45:59 -05:00
|
|
|
|
2010-04-05 00:06:26 -04:00
|
|
|
# The same with rescue, append it at the end to wrap as much as possible.
|
|
|
|
Rescue
|
|
|
|
]
|
2010-03-13 15:28:34 -05:00
|
|
|
|
2010-04-05 00:06:26 -04:00
|
|
|
MODULES.each do |mod|
|
|
|
|
include mod
|
|
|
|
end
|
|
|
|
|
|
|
|
# Rails 2.x compatibility
|
|
|
|
include ActionController::Compatibility
|
2006-08-07 02:11:56 -04:00
|
|
|
|
2009-06-15 14:44:45 -04:00
|
|
|
def self.inherited(klass)
|
|
|
|
::ActionController::Base.subclasses << klass.to_s
|
|
|
|
super
|
2010-01-24 06:04:37 -05:00
|
|
|
klass.helper :all
|
2009-06-15 14:44:45 -04:00
|
|
|
end
|
2008-11-01 07:16:15 -04:00
|
|
|
|
2009-06-15 14:44:45 -04:00
|
|
|
def self.subclasses
|
|
|
|
@subclasses ||= []
|
|
|
|
end
|
2008-11-01 07:16:15 -04:00
|
|
|
|
2010-04-22 06:00:13 -04:00
|
|
|
# TODO Move this to the appropriate module
|
|
|
|
config_accessor :assets_dir, :asset_path, :javascripts_dir, :stylesheets_dir
|
|
|
|
|
2010-03-29 20:08:08 -04:00
|
|
|
ActiveSupport.run_load_hooks(:action_controller, self)
|
2008-11-23 17:35:13 -05:00
|
|
|
end
|
2007-09-13 20:25:59 -04:00
|
|
|
end
|
2010-03-04 15:21:49 -05:00
|
|
|
|
2010-04-22 06:00:13 -04:00
|
|
|
require "action_controller/deprecated/base"
|