On Apr 10, 2009, at 8:53 AM, Ian wrote:
>
> I have a tag cloud going and a route defined like so:
>
> map.connect ''tags/:id'', :controller =>
"tag", :action => "browse"
>
> Works great, except when the phrase has a period in it (like "Web
> 2.0") Then I get a 404, presumably because Rails is interpreting that
> as a file name and an extension. I have wrapped CGI::escape around it
> but that doesn''t seem to affect periods. What''s the best
way to
> handle this?
I had a route where the :id could contain digits and/or a period.
This worked for me.
:requirements => { :id => %r([-\d.]+) }
Tweak that to allow your other characters and you should be all
right. However, in my case the full route was /foo/:id/:bar so maybe
having it in the middle makes a difference.
Good luck!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---