I'm using devise and started to implement omniauth-instagram. However, I keep getting an error that reads:
uninitialized constant Users::Auth::Instagram::CallbackController
I'm not sure which part of my configuration is incorrect so I've included some excerpts from my routes.db , omniauth_callbacks_controllers.rb, and devise.rb for reference.
Any points in the right direction would be greatly appreciated!
routes.db
devise_for :users, :controllers => { :omniauth_callbacks => "users/auth/instagram/callbacks" }
/controllers/users/omniauth_callbacks_controllers.rb
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def instagram
# You need to implement the method below in your model (e.g. app/models/user.rb)
@user = User.find_for_oauth(request.env["omniauth.auth"], current_users)
if @user.persisted?
sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated
set_flash_message(:notice, :success, :kind => "Instagram") if is_navigational_format?
else
session["devise.instagram_data"] = request.env["omniauth.auth"]
redirect_to new_user_registration_url
end
end
end
devise.rb
config.omniauth_path_prefix = 'users/auth/instagram/callbacks'