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.

constraints with resources in routes don't catch regex

#4189

resources :resource, :constraints => { :id => /regex/ }

doesn't catch the regex and lets the request through to the controller

match 'path/:id' => 'controller#action', :constraints => { :id => /regex/ }

does work

The old :conditions format used to work

Reported by Anthony Green · March 16th, 2010 @ 07:42 AM

State: resolved
Milestone: 3.0.2
Assigned to: josh josh
Importance: Low

Activity

  1. José Valim
    José Valim
    • Assigned user set to josh
    • Milestone cleared.

    March 27th, 2010 @ 02:01 PM

  2. Andrew White
    Andrew White
    • Tag changed from constraints routes to 3.0, constraints, patch, resources, routes

    Attached patch adds support for constraints on resources.

    March 28th, 2010 @ 11:32 AM

  3. Rizwan Reza
  4. Rizwan Reza
    Rizwan Reza

    Forgot to say: Thanks, Andrew. :)

    March 28th, 2010 @ 08:08 PM

  5. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Low

    October 15th, 2010 @ 11:01 PM