without_modules

without_modules(*modules)
Class Public methods

Shortcut helper that returns all the modules included in ActionController::Base except the ones passed as arguments:

1
2
3
4
5
class MetalController
  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.

doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.