我正在尝试连接fitbit api。我正在尝试学习Oauth on Rails
设备/控制器
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”=> “中利... I5”, “提供者”=> “中fitbit”}
并收到错误:
ActiveRecord::DangerousAttributeError in DevicesController#create
有关如何解决此问题的任何想法?感谢