Hi,
been doing some tiny app in Rails 3 to get the hang of it. From the
official
guide currently I don’t know how to do the routes trick:
map.resources :books, :path_prefix => ‘/:locale’
It’s probably me but I can’t find proper rails 3 documentation anywhere.
Anyone got a link? Didn’t find any more doc on the new router than
what’s on
the routes.rb in a new app.
I think you also have to add the :localize argument to all your
generated paths, fx book_path(book, :localize => ‘de’)
Personally I think this approach is a bit crazy, must be an easier
option. Check out my post on this for a solution
module ActionController::PolymorphicRoutes
…
def polymorphic_url
…
add default locale from session (retrieved from prefix on route
path)
args << {:locale => session[:locale]} if session[:locale] send(named_route, *args)
end