instance method
controller
Ruby on Rails 7.1.6
Since v3.2.22.5 Last seen in v7.1.6Signature
controller()
Gets a new instance of a controller object.
This method assumes an ApplicationController exists, and that it extends ActionController::Base.
Source
# File railties/lib/rails/console/helpers.rb, line 15
def controller
@controller ||= ApplicationController.new
end
Defined in railties/lib/rails/console/helpers.rb line 15
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::ConsoleMethods