【发布时间】:2013-05-21 18:42:52
【问题描述】:
对于设计,有一个非常易于使用的 Before_filter 在控制器中使用。
由于某种原因,我无法让它为 Omniauth_facebook Gem 工作。我在 Facebook Omniauth 上关注了 Railscast,也关注了
before_filter :authenticate
def authenticate
redirect_to :login unless User.find_by_provider_and_uid(auth["provider"], auth["uid"])
end
end
但我得到一个错误:
NameError in PostsController#new
undefined local variable or method `auth' for #<PostsController:0x007f9fbfa7ee58>
有什么想法吗?
【问题讨论】:
标签: ruby-on-rails authentication omniauth