I am a rails newbie... I am trying to set up Sign in with facebook for a demo app. I am using OmniAuth and following this tutorial
https://github.com/plataformatec/devi
I believe that part is messing up:
match '/users/auth/facebook' => 'users/omniauth_callbacks#passthru'
Little test, for you:
put in your view:
<%= link_to users_auth_facebook_path, users_auth_facebook_path %>
and follow it with click, it also gives very same error...
I believe you should use something like (what is mentioned in wiki you linked above):
devise_scope :user do
get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru'
end
And wrap passthru method to delegate action to appropriate private/protected method depending on params[:provider] value
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def passthru
send(params[:provider]) if providers.include?(params[:provider])
end
protected
def facebook
raise "Implement me for facebook"
end
def twitter
raise "Implement me for twitter"
end
private
def providers
["facebook", "twitter"]
end
end