我的登录&自从我将i18n翻译安装到我的应用程序后,注册页面不再有效。 (应用程序的其余部分完美地使用英语/ Chinse / French直到我退出) 我已将路线修改为
Rails.application.routes.draw do
scope "/:locale", locale: /#{I18n.available_locales.join("|")}/ do
devise_for :users
resources :users, :only => [:show, :edit, :update]
resources :users do
resources :profile
end
get 'users/show'
get 'users/:id' => 'users#show'
get 'users', to: 'users#index'
get 'users/update'
get 'users/index'
root to: redirect("/%{locale}/posts", status: 302)
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
BUt我仍然有以下错误:
ActiveRecord::RecordNotFound in UsersController#show
Couldn't find User with 'id'=sign_in
是否应该更改Devise工作的任何内容?