method
without_modules
Ruby on Rails latest stable (v7.1.3.2)
-
1 note -
Class: ActionController::Base
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0 (0)
- 3.0.9 (0)
- 3.1.0 (0)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (38)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (2)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
without_modules(*modules)
public
Shortcut helper that returns all the modules included in ActionController::Base except the ones passed as arguments:
class MyBaseController < ActionController::Metal ActionController::Base.without_modules(:ParamsWrapper, :Streaming).each do |left| include left 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 the modules required manually.
Register or
log in
to add new notes.
BroiSatse -
April 9, 2014 - (>= v4.0.2)
0 thanks
Requires inheritance of ActionController::Metal
The example code will not work unless class inherits from ActionController::Metal (to get functioning controller) or at least AbstractController:Base.