instance method
controller
Ruby on Rails 6.0.6
Since v3.0.20Signature
controller(controller)
Scopes routes to a specific controller
controller "food" do match "bacon", action: :bacon, via: :get end
Parameters
-
controllerreq
Source
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 900
def controller(controller)
@scope = @scope.new(controller: controller)
yield
ensure
@scope = @scope.parent
end
Defined in actionpack/lib/action_dispatch/routing/mapper.rb line 900
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Routing::Mapper::Scoping