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.

Show route is matched instead of edit if resource :id regexp is greedy

#5409

The current order of resource routes means that if the :id regexp is greedy it will match show rather than edit, e.g:

resources :sections, :id => /.+/

# GET /sections/1/edit
=> { :controller => 'sections', :action => 'show', :id => '1/edit' }

The attached patch resolves this by moving the edit route before the show route.

Reported by Andrew White · August 19th, 2010 @ 02:41 PM

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