From 945ee359331a0058d34e1d203b9ebe1cc0af19a1 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Tue, 6 Mar 2012 09:04:06 -0300 Subject: Add some docs for ActionController::Base.without_modules --- actionpack/lib/action_controller/base.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack') 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 -- cgit v1.2.3 From 35922c0f82cec8f0094d56838c8ecd2ae989f109 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 7 Mar 2012 20:32:25 +0530 Subject: copy edits [ci skip] --- actionpack/lib/action_controller/base.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index e20ba8f7b5..e504a083c9 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -171,7 +171,7 @@ module ActionController class Base < Metal abstract! - # Shortcut helper to map all ActionController default modules except the ones given: + # 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| @@ -180,7 +180,7 @@ module ActionController # 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. + # 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 -- cgit v1.2.3