1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add some docs for ActionController::Base.without_modules

This commit is contained in:
Carlos Antonio da Silva 2012-03-06 09:04:06 -03:00
parent f434fa846e
commit 945ee35933

View file

@ -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