Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Rack::Mount blows up if passed invalid constraints

#4989

If you use scope to specify some constraints that aren't used within a route inside that scope then Rack::Mount raises an exception. The attached patch removes any constraints that are not in the list segment keys or is not a public instance method on the request class.

Reported by Andrew White · June 28th, 2010 @ 01:01 AM

State: resolved
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: High

Activity

  1. Andrew White
    Andrew White

    An example routes.rb file that shows this error is:

    scope :constraints => { :id => /\d+/ } do
      resources :products
      resources :images
    end
    

    June 28th, 2010 @ 01:03 AM

  2. Andrew White
    Andrew White

    Updated patch to use only instance variables and pass in RouteSet as first parameter.

    June 28th, 2010 @ 01:38 AM

  3. Repository
  4. Jeremy Kemper