Ruby on Rails でappにユーザーページを追加しているのですが、
routesとusers_controllerの設定を
Rails.application.routes.draw do resources :users devise_for :users resources :messages do resources :comments end root 'messages#index' end
before_action :find_user def show end private def find_user @user = User.find(params[:id]) end end
のようにしているのですが、この場合だとサイトログインページが、以下のerrorように
idの部分がsign_inになりerrorになってしまいます。
users/1のようなユーザーページとuser/sign_inのように、ログインページをそれぞれerror出さずにするにはどうすればいいですか?
ActiveRecord::RecordNotFound in UsersController#show Couldn't find User with 'id'=sign_in
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。