routes.rb 669 B

12345678910111213141516171819
  1. Rails.application.routes.draw do
  2. scope '(:locale)', locale: /#{I18n.available_locales.join('|')}/ do
  3. I18n.locale = :locale
  4. end
  5. if :locale == nil
  6. locale = I18n.default_locale
  7. end
  8. root "main#index"
  9. get "/:locale", to: "main#index", as: 'main'
  10. get "/profile", to: "profile#index", as: 'profile'
  11. get "/:locale/profile", to: "profile#index"
  12. get "/projects", to: "projects#index"
  13. get "/:locale/projects", to: "projects#index", as: 'project_index'
  14. get "/projects/:permalink", to: "projects#show", as: 'project_show'
  15. get "/:locale/projects/:permalink", to: "projects#show"
  16. get "/help", to: "help#index"
  17. end