Hi, I''ve created my own locale handling system with the following route
added in routes.rb :
map.connect '':locale/:controller/:action/:id''
Works fine.
Then, I''ve added Admin namespace for all the backoffice controllers
app/controller/admin/
Then I''ve added this route to routes.rb
map.connect ''/admin/:controller/:action/:id''
With this setup, all the functional test runs fine for admin and
non-admin controllers, with locale beeing taken in account only for non
admin controllers.
But with webrick (restarted after every routes.rb modification) I need
to
/en/admin/news to reach the Admin::news controller
instead of (you might guess)
/admin/news which produce a
no route found to match "/admin/news" with {:method=>:get}
I must be wrong, but where ??
Thanks
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
In your example with WEBrick /admin/news will look for a controller at /app/controllers/news_controller.rb. Having the static "/admin" does not affect where it looks for the controller. Your tests run because they are relative to the path for the test. Your controller value should be "admin/news" given your directory structure. I am not sure how to construct a route that would contain a slash however. Michael nuno wrote:> Hi, I''ve created my own locale handling system with the following route > added in routes.rb : > map.connect '':locale/:controller/:action/:id'' > > Works fine. > > Then, I''ve added Admin namespace for all the backoffice controllers > app/controller/admin/ > > Then I''ve added this route to routes.rb > map.connect ''/admin/:controller/:action/:id'' > > With this setup, all the functional test runs fine for admin and > non-admin controllers, with locale beeing taken in account only for non > admin controllers. > > But with webrick (restarted after every routes.rb modification) I need > to > /en/admin/news to reach the Admin::news controller > instead of (you might guess) > /admin/news which produce a > no route found to match "/admin/news" with {:method=>:get} > > > I must be wrong, but where ?? > > Thanks > > -- > Posted via http://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---