class method
self.without_modules
Ruby on Rails 8.1.2
Since v5.2.8.1Signature
self.without_modules(*modules)
Shortcut helper that returns all the ActionController::API modules except the ones passed as arguments:
class MyAPIBaseController < ActionController::Metal ActionController::API.without_modules(:UrlFor).each do |left| include left end end
This gives better control over what you want to exclude and makes it easier to create an API controller class, instead of listing the modules required manually.
Parameters
-
modulesrest
Source
# File actionpack/lib/action_controller/api.rb, line 108
def self.without_modules(*modules)
modules = modules.map do |m|
m.is_a?(Symbol) ? ActionController.const_get(m) : m
end
MODULES - modules
end
Defined in actionpack/lib/action_controller/api.rb line 108
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::API