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:
parent
f434fa846e
commit
945ee35933
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue