routing problem: map.testroute ":param1/:param2-:param3-:param4.html"

lowang
Tue, 15 Apr 2008 14:20:42 -0000

hi,

I''m trying to create meaningful urls with routing extracting all
params as specified:

map.testroute ":param1/:param2-for-:param3.html"

However this approach totally fails - it says Routing Error, No route
matches "/aaaa/bbbb-for-ccc.html" with {:method=>:get}

Then while browsing source code and some googling I''ve found that
there is sth called

ActionController::Routing::SEPARATORS

so I''ve modified it in environment.rb:

ActionController::Routing::SEPARATORS << ''-''
ActionController::Routing::Routes.reload!

Things were getting better now, request was processed as expected,
however param1 does not accept - in it so:

GET /aa-aa/bbbb-for-ccc.html

still says:

No route matches "/aa-aa/bbbb-for-ccc.html" with {:method=>:get}

Right now I''m out of ideas how to fix this using routes, probably
I''ll
try to create glob route and extract all params in before_filter.

Does anyone has an idea how to solve such problem ?

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---