I found similar threads on SO, but none of them helped me solve this problem. My routes look like this:
devise_for :users do post '/users' => 'registrations#create', :as => 'user_registration' end devise_for :users, :controllers => {:omniauth_callbacks => "users/omniauth_callbacks"}
Ive also tried:
devise_for :users, :controllers => {:omniauth_callbacks => "omniauth_callbacks"}
But I still get
The action 'facebook' could not be found for Devise::OmniauthCallbacksController
I even tried to restart the server, but that didn't help me. I follow this tutorial .
omniauth_callbacks_controller.rb :
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController def facebook @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) if @user.persisted? puts @user.inspect flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook" sign_in_and_redirect @user, :event => :authentication else session["devise.facebook_data"] = request.env["omniauth.auth"] redirect_to new_user_registration_url end end end
source share