我在使用标题上显示的错误时遇到了Devise / Omniauth的问题。这是它指出的界限:
<%= link_to "Sign In With Facebook", user_facebook_omniauth_authorize_path, class: "btn btn-primary" %>
这是我的路线
Rails.application.routes.draw do
root 'pages#home'
devise_for :users,
:path => '',
:path_names => {:sign_in => 'login', :sign_out => 'logout', :edit => 'profile'},
:controllers => {:omniauth_callbacks => 'omniauth_callbacks'}
end
相关的Rake路线
user_omniauth_authorize GET|POST /auth/:provider(.:format)
omniauth_callbacks#passthru {:provider=>/facebook/}
user_omniauth_callback GET|POST /auth/:action/callback(.:format)
omniauth_callbacks#(?-mix:facebook)
答案 0 :(得分:2)
希望这能完成这项工作。
user_omniauth_authorize_path(:facebook)