Permalink
Browse files

Add some docs for ActionController::Base.without_modules

  • Loading branch information...
1 parent f434fa8 commit 945ee359331a0058d34e1d203b9ebe1cc0af19a1 @carlosantoniodasilva carlosantoniodasilva committed Mar 6, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 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

0 comments on commit 945ee35

Please sign in to comment.