Ruby Forum Rails-core (closed, excessive spam) > Bug in Rails Route Globbing

Posted by Chris Roos (Guest)
on 08.05.2008 17:46
(Received via mailing list)
Slashes in the 'globbed' parameters are not escaped.  I've got a
failing test and patch ready to submit (I'll update the thread once
I've got them submitted) but wondered if others could comment on
whether they expect the behaviour I've outlined below?

Given this route:
map.connect 'glob/show/*additional', :controller => 'glob', :action =>
'show'

And this template:
<p><%= link_to 'test route globbing', :controller => 'glob', :action
=> 'show', :additional => ['foo/bar', 'baz'] %></p>

I'd expect the generated URL to be (note the escaped slash between foo
and bar):
<p><a href="/glob/show/foo%2Fbar/baz">test route globbing</a></p>

Instead, the generated URL is:
<p><a href="/glob/show/foo/bar/baz">test route globbing</a></p>

Cheers,

Chris
Posted by Chris Roos (Guest)
on 08.05.2008 18:06
(Received via mailing list)
Here's the ticket and patch - 
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/144

I'm afraid the patch is just the output of svn diff as I'm not on the
git ship just yet.  Is it hard to convert the output of svn diff
(diff) to something that git understands?

Chris