fitbit api に接続しようとしています。Rails で Oauth を学習しようとしています
デバイス/コントローラー
def create
device = request.env["omniauth.auth"]
current_user.devices.find_or_create_by_provider_and_oauth_token_and_oauth_verifier(device['provider'], device['oauth_token'], device["oauth_verifier"])
flash[:notice] = "Device Successfully connected."
redirect_to devices_url
end
そこで、資格情報を使用して fitbit を呼び出し、ユーザー トークンと検証者を要求します。私はパラメータを受け取っています:
{"oauth_token"=>"1c...d7e",
"oauth_verifier"=>"li...i5", "provider"=>"fitbit"}
そしてエラーを受け取ります:
ActiveRecord::DangerousAttributeError in DevicesController#create
これを修正する方法についてのアイデアはありますか?ありがとう