提交 945ee359 编写于 作者: C Carlos Antonio da Silva

Add some docs for ActionController::Base.without_modules

上级 f434fa84
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册