kwi / i18n_routing

I18n routing module for Rails 2.3.x and Rails 3. Translate your routes with ease !
MIT License
228 stars 48 forks source link

Nested ressources don't work (Rails 3.1, Ruby 1.9.2) #29

Open ncri opened 13 years ago

ncri commented 13 years ago

Given a nested route like this:

  localized do 
    resources :users do 
      resources :videos 
    end 
  end 

with a path_name translation key

locale: 
  routes: 
    users: 
      path_names: 
        new: translated_new

path_names.new is wrongly recognized as belonging to videos and the new path segment for new_user_path is not translated.

Workaround: removing the nested resource and adding an extra block:

localized do 
  resources :users 
end 

resources :users do 
  localized do 
    resources :videos 
  end 
end 

However, this is not very clean and I also don't know where to store the translations for the nested videos resource.