https://teratail.com/questions/98449
似ていると思われるこちらは確認しました。
routeがうまくいっていないのか、railsの初期画面(Yay! You’re on Rails!)にレンダリングされる。
対処方法がわからないのでこちらのPRで質問する。
なお、branchの切り方がおかしいのは最初に欲張ってうまく分けられなかったからです。
あやしそうなのは
config/route.rb
Rails.application.routes.draw do get 'rooms/show' devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' } # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end
app/models/user.rb
class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable, :omniauthable # omniauthのコールバック時に呼ばれるメソッド def self.from_omniauth(auth) where(provider: auth.provider, uid: auth.uid).first_or_create do |user| user.email = auth.info.email user.password = Devise.friendly_token[0,20] end end end
変更後
class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable, :omniauthable end
config/initialize/devie.rb
字数制限にかかってしまったので
https://github.com/tanakanaoko/chat-app/pull/2/files#diff-a8a4112d0760c0fd11f691c6a5fb22ad
でみていただけると嬉しいです。
こちらのコメントアウトされている部分がどのようにうごいているのかわからず、そのままにしてあります。
みなさま、お力添えをいただけますでしょうか?よろしくおねがいいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。