aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.rb
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-03-09 00:07:59 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-03-09 00:07:59 +0530
commit188d1d27876018c492280059b3d721be9afcc231 (patch)
tree20037458a5814681e78858c93eef14cc893ffe44 /actionpack/lib/action_controller/base.rb
parent085cb3b9af9d74fa9a3b72181f674f0b7c3dbf01 (diff)
parent97e7d43146b6edca19891d8c7ed6b4d93e7dad00 (diff)
downloadrails-188d1d27876018c492280059b3d721be9afcc231.tar.gz
rails-188d1d27876018c492280059b3d721be9afcc231.tar.bz2
rails-188d1d27876018c492280059b3d721be9afcc231.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-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 e20680ef35..95de595f4f 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 that returns all the ActionController modules except the ones passed in the argument:
+ #
+ # 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 the modules required manually.
def self.without_modules(*modules)
modules = modules.map do |m|
m.is_a?(Symbol) ? ActionController.const_get(m) : m