tuxwebror/config/routes.rb

13 lines
473 B
Ruby
Raw Normal View History

2018-12-21 19:06:39 +01:00
Rails.application.routes.draw do
scope "/:locale", locale: /#{I18n.available_locales.join("|")}/ do
resources :users
post "/users/:id/edit", to: "users#validate_key", as: "validate_user"
root to: "pages#home"
end
root to: redirect("/#{I18n.default_locale}", status: 302), as: :redirected_root
get "/*path",
to: redirect("/#{I18n.default_locale}/%{path}", status: 302),
constraints: {path: /(?!(#{I18n.available_locales.join("|")})\/).*/},
format: false
end