aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-03-06 09:04:06 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-03-06 23:50:55 -0300
commit945ee359331a0058d34e1d203b9ebe1cc0af19a1 (patch)
treec1b26ea99afc01af6177120ea33f06780aba4f7e /actionpack/lib/action_controller
parentf434fa846ecd564e1bb6f82025a94c03c22eff59 (diff)
downloadrails-945ee359331a0058d34e1d203b9ebe1cc0af19a1.tar.gz
rails-945ee359331a0058d34e1d203b9ebe1cc0af19a1.tar.bz2
rails-945ee359331a0058d34e1d203b9ebe1cc0af19a1.zip
Add some docs for ActionController::Base.without_modules
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/base.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 3b82231b15..e20ba8f7b5 100644
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -171,6 +171,16 @@ module ActionController
class Base < Metal
abstract!
+ # Shortcut helper to map all ActionController default modules except the ones given:
+ #
+ # class MetalController
+ # ActionController::Base.without_modules(:ParamsWrapper, :Streaming).each do |module|
+ # include module
+ # end
+ # end
+ #
+ # This gives better control over what you want to exclude and makes it easier
+ # to create a bare controller class, instead of listing each required module manually.
def self.without_modules(*modules)
modules = modules.map do |m|
m.is_a?(Symbol) ? ActionController.const_get(m) : m