module ActionDispatch::Routing::Mapper::Scoping
def controller(controller, options = {})
match "bacon", action: :bacon, via: :get
controller "food" do
Scopes routes to a specific controller
def controller(controller, options = {}) if options.empty? begin @scope = @scope.new(controller: controller) yield ensure @scope = @scope.parent end else ActiveSupport::Deprecation.warn "#controller with options is deprecated. If you need to pass more options than the controller name use #scope." options[:controller] = controller scope(options) { yield } end end