【发布时间】:2011-10-12 01:11:36
【问题描述】:
我将 OmniAuth gem 与我的 Rails 应用程序一起使用,以允许用户将他们的 Facebook 帐户添加到应用程序,并且我正在关注 Ryan Bates 的教程,但我继续收到此 Rails 错误。
用于#的未定义局部变量或方法`authentications_url'
这是用于身份验证的控制器:
class AuthenticationsController < ApplicationController
def index
@authentications = current_user.authentications if current_user
end
def create
auth = request.env["omniauth.auth"]
current_user.authentications.find_or_create_by_provider_and_uid(auth['provider'],auth['uid'])
flash[:notice] = "Authentication successful."
redirect_to authentications_url
end
def destroy
@authentication = current_user.authentications.find(params[:id])
@authentication.destroy
flash[:notice] = "Successfully destroyed authentication."
redirect_to authentications_url
end
结束
【问题讨论】:
标签: ruby-on-rails ruby omniauth