嗨,我正在关注 Railcasts:#241 简单的 Omniauth 教程,因此我可以让用户使用 omniauth-twitter gem 登录到我的示例应用程序,但是在进入教程的 /auth/twitter 阶段时出现路由错误。
经过几次在线搜索后,我添加的内容 :strategy_class => OmniAuth::Strategies::Twitter 到我的omniauth.rb 文件中。但是我遇到了同样的问题,但是现在当我运行 rake route 时,我得到了以下路由:
/auth/:provider/callback(.:format) sessions#create
auth_failure /auth/failure(.:format) :controller#:action
我想这意味着它现在正在联系omniauth-twitter gem,但我仍然无法让/auth/twitter 工作。
我认为我需要做的: 我认为我需要在我的 rake 路线中显示以下内容。omniauth_authorize GET|POST /auth/:provider(.:format) /omniauth_callbacks
任何帮助将不胜感激。先感谢您
标记。