2009-06-15 18:44:45 +00:00
module ActionController
2009-08-06 22:50:22 +00:00
class Base < Metal
2009-06-15 18:44:45 +00:00
abstract!
include AbstractController :: Callbacks
2009-12-31 00:33:54 +00:00
include AbstractController :: Layouts
2010-01-20 13:41:23 +00:00
include AbstractController :: Translation
2009-06-15 18:44:45 +00:00
include ActionController :: Helpers
2010-01-04 02:32:02 +00:00
2009-06-15 18:44:45 +00:00
include ActionController :: HideActions
include ActionController :: UrlFor
2009-12-21 01:25:13 +00:00
include ActionController :: Redirecting
2009-12-21 01:15:31 +00:00
include ActionController :: Rendering
2009-12-21 02:15:20 +00:00
include ActionController :: Renderers :: All
2009-06-15 18:44:45 +00:00
include ActionController :: ConditionalGet
2009-12-21 02:05:26 +00:00
include ActionController :: RackDelegation
2009-10-26 22:47:08 +00:00
include ActionController :: Configuration
2009-06-15 18:44:45 +00:00
# Legacy modules
include SessionManagement
include ActionController :: Caching
include ActionController :: MimeResponds
# Rails 2.x compatibility
2009-12-03 04:01:01 +00:00
include ActionController :: Compatibility
2009-06-15 18:44:45 +00:00
include ActionController :: Cookies
include ActionController :: Flash
include ActionController :: Verification
include ActionController :: RequestForgeryProtection
include ActionController :: Streaming
include ActionController :: HttpAuthentication :: Basic :: ControllerMethods
include ActionController :: HttpAuthentication :: Digest :: ControllerMethods
2010-01-12 23:41:04 +00:00
# Add instrumentations hooks at the bottom, to ensure they instrument
# all the methods properly.
include ActionController :: Instrumentation
2009-06-15 18:44:45 +00:00
# TODO: Extract into its own module
# This should be moved together with other normalizing behavior
module ImplicitRender
def send_action ( * )
ret = super
2009-08-09 06:05:04 +00:00
default_render unless response_body
2009-06-15 18:44:45 +00:00
ret
end
def default_render
render
2007-02-04 22:27:45 +00:00
end
2008-05-14 18:00:09 +00:00
2009-06-15 18:44:45 +00:00
def method_for_action ( action_name )
super || begin
2009-09-03 19:41:28 +00:00
if template_exists? ( action_name . to_s , { :formats = > formats } , :_prefix = > controller_path )
2009-06-15 18:44:45 +00:00
" default_render "
end
2009-04-23 22:58:38 +00:00
end
end
2004-11-24 01:04:44 +00:00
end
2009-06-15 18:44:45 +00:00
include ImplicitRender
2008-12-25 20:45:59 +00:00
2009-06-15 18:44:45 +00:00
include ActionController :: Rescue
2006-08-07 06:11:56 +00:00
2009-06-15 18:44:45 +00:00
def self . inherited ( klass )
:: ActionController :: Base . subclasses << klass . to_s
super
2010-01-24 11:04:37 +00:00
klass . helper :all
2009-06-15 18:44:45 +00:00
end
2008-11-01 11:16:15 +00:00
2009-06-15 18:44:45 +00:00
def self . subclasses
@subclasses || = [ ]
end
2008-11-01 11:16:15 +00:00
2010-01-21 10:39:57 +00:00
# This method has been moved to ActionDispatch::Request.filter_parameters
2010-01-21 15:50:11 +00:00
def self . filter_parameter_logging ( * args , & block )
2010-01-21 10:39:57 +00:00
ActiveSupport :: Deprecation . warn ( " Setting filter_parameter_logging in ActionController is deprecated and has no longer effect, please set 'config.filter_parameters' in config/application.rb instead " , caller )
2010-01-21 15:50:11 +00:00
filter = Rails . application . config . filter_parameters
filter . concat ( args )
filter << block if block
filter
2010-01-21 10:39:57 +00:00
end
2008-11-23 22:35:13 +00:00
end
2007-09-14 00:25:59 +00:00
end