Created
April 4, 2012 19:01
-
-
Save pifleo/2304771 to your computer and use it in GitHub Desktop.
Rails - I18n routes translation with nested resources and members
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rake routes | grep users | |
... | |
followed_projects_user GET /users/:id/followed_projects(.:format) users#followed_projects | |
questions_user GET /users/:id/questions(.:format) users#questions | |
parameters_user GET /users/:id/parameters(.:format) users#parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
# routes translation | |
# https://github.com/kwi/i18n_routing | |
gem 'i18n_routing' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fr: | |
routes: | |
users: | |
as: utilisateurs | |
path_names: | |
new: 'nouvel' | |
edit: 'edition' | |
parameters: parametres | |
followed_projects: projets-suivis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
localized([:fr]) do | |
resources :users do |user| | |
get :followed_projects, :on => :member | |
get :questions, :on => :member | |
get :parameters, :on => :member | |
resources :companies | |
resources :profiles, :except => [ :index, :new, :create ] | |
resources :subscriptions | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment