ユーザーがツイッターに登録するとき、私は彼の名前、場所などをユーザーレコードに追加しようとしています。私は何かをしたいと思うuser.build
こちらがコントローラー。これが起こることです:
user = User.new
user.apply_omniauth(omni)
if user.save
flash[:notice] = "Logged In!"
sign_in_and_redirect(:user, user)
else
session[:omniauth] = omni.except('extra')
redirect_to new_user_registration_path
end
ユーザーが twitter に存在しない場合、ユーザーは登録を完了する登録パスにリダイレクトされます。Twitter の余分なものを、まだ保存されていないユーザー アカウントに追加したいと考えています。user.apply_omniauth(omni)
認証テーブルに保存されるため、メソッドでは実行できません。
何か案は?
ありがとう!