I tried this on a test app on my side and it does not really seem to
work. Are we sure the gem supports the scope construct?
I just created a little test application and I does not seem to work.
My routes.rb looks like this:
localized do
scope (":locale") do
resource :home
end
end
and rake routes returns this:
en_home POST /:locale/home(.:format)
{:i18n_locale=>"en", :action=>"create", :controller=>"homes"}
new_en_home GET /:locale/home/new(.:format)
{:i18n_locale=>"en", :action=>"new", :controller=>"homes"}
edit_en_home GET /:locale/home/edit(.:format)
{:i18n_locale=>"en", :action=>"edit", :controller=>"homes"}
en_home GET /:locale/home(.:format)
{:i18n_locale=>"en", :action=>"show", :controller=>"homes"}
en_home PUT /:locale/home(.:format)
{:i18n_locale=>"en", :action=>"update", :controller=>"homes"}
en_home DELETE /:locale/home(.:format)
{:i18n_locale=>"en", :action=>"destroy", :controller=>"homes"}
fr_home POST /:locale/accueil(.:format)
{:i18n_locale=>"fr", :action=>"create", :controller=>"homes"}
new_fr_home GET /:locale/accueil/new(.:format)
{:i18n_locale=>"fr", :action=>"new", :controller=>"homes"}
edit_fr_home GET /:locale/accueil/edit(.:format)
{:i18n_locale=>"fr", :action=>"edit", :controller=>"homes"}
fr_home GET /:locale/accueil(.:format)
{:i18n_locale=>"fr", :action=>"show", :controller=>"homes"}
fr_home PUT /:locale/accueil(.:format)
{:i18n_locale=>"fr", :action=>"update", :controller=>"homes"}
fr_home DELETE /:locale/accueil(.:format)
{:i18n_locale=>"fr", :action=>"destroy", :controller=>"homes"}
home POST /:locale/home(.:format)
{:action=>"create", :controller=>"homes"}
new_home GET /:locale/home/new(.:format)
{:action=>"new", :controller=>"homes"}
edit_home GET /:locale/home/edit(.:format)
{:action=>"edit", :controller=>"homes"}
home GET /:locale/home(.:format)
{:action=>"show", :controller=>"homes"}
home PUT /:locale/home(.:format)
{:action=>"update", :controller=>"homes"}
home DELETE /:locale/home(.:format)
{:action=>"destroy", :controller=>"homes"}
and yet if I try to access /fr/accueil on my server, I get his:
Routing Error
No route matches "/fr/accueil"
any ideas what I might be doing wrong?