This project is archived and is in readonly mode.
Slash gets escaped when globbing a route
Reported by Brian Rose | July 16th, 2010 @ 10:40 PM
Given a route defined as:
match '*section_path' => "sections#show"
When I specify:
def test "globbed route"
assert_routing('/company/about', { :controller => 'pages', :action => 'show', :path => 'company/about' })
end
Then I receive an error stating 'The generated path <"/about%2Fabout-company"> did not match <"/about/about-company">.'
Comments and changes to this ticket
-
Brian Rose July 17th, 2010 @ 11:31 PM
- Tag changed from tests actionpack, glob, router to rails 3, tests actionpack, glob, router
-
eagle.anton (at gmail) July 21st, 2010 @ 02:23 PM
- Tag changed from rails 3, tests actionpack, glob, router to rails 3, slash escape, tests actionpack, glob, router
Confirm this but not only for globbing.
For example this route:
match "/:path" => "pages#show", :constraints => {:path => /.+(\/.+)*/ } assert_routing '/directory/filename', :controller => 'pages', :action => 'show', :path => 'directory/filename' The generated path <"/directory%2Ffilename"> did not match <"/directory/filename">
Patch solves the problem.
-
David Chelimsky July 21st, 2010 @ 02:35 PM
- Assigned user set to José Valim
- Tag changed from rails 3, slash escape, tests actionpack, glob, router to rails 3, slash escape, tests actionpack, glob, patch, router
-
Repository July 21st, 2010 @ 09:19 PM
- State changed from new to resolved
(from [622092d33e8d326217ab1ed6138e2c572c95b8ba]) Fixed a globbed route issue where slashes were being escaped, causing assert_routing to fail. [#5135 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/622092d33e8d326217ab1ed6138e2c...
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
- 2905 Named routes do not handle parameters with a "/" in the values Does the patch found at https://rails.lighthouseapp.com/...
- 5135 Slash gets escaped when globbing a route (from [622092d33e8d326217ab1ed6138e2c572c95b8ba]) Fixed a...