This project is archived and is in readonly mode.
Show route is matched instead of edit if resource :id regexp is greedy
Reported by Andrew White | August 19th, 2010 @ 02:41 PM | in 3.0.2
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.
Comments and changes to this ticket
-
Andrew White August 19th, 2010 @ 02:43 PM
- no changes were found...
-
Repository August 19th, 2010 @ 07:08 PM
- State changed from open to resolved
(from [0cc483aa14d79b2d07fdc71dbd935d1af8361d71]) Move edit route before show route so that it will have precedence if the :id parameter allows slashes [#5409 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/0cc483aa14d79b2d07fdc71dbd935d... -
Repository August 19th, 2010 @ 07:10 PM
(from [1031fe1478bdccebfed788a309f5aedfca82d57e]) Move edit route before show route so that it will have precedence if the :id parameter allows slashes [#5409 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/1031fe1478bdccebfed788a309f5ae...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 5409 Show route is matched instead of edit if resource :id regexp is greedy (from [0cc483aa14d79b2d07fdc71dbd935d1af8361d71]) Move ed...
- 5409 Show route is matched instead of edit if resource :id regexp is greedy (from [1031fe1478bdccebfed788a309f5aedfca82d57e]) Move ed...