I am trying to provide Sign Up with either an email and password or using Facebook.
I have tried using https://github.com/plataformatec/devise/wiki/OmniAuth%3a-Overview
I followed each of the steps, but I run into the following error in Terminal when I try to run rails server:
'users/omniauth.callbacks' is not a supported controller name
I thought this was referring to the file I was instructed to make (app/controllers/users/omniauth_callback_controllers.rb) but deleting the file does nothing. I have Devise implemented, and I also installed the Omniauth gem. What am I doing incorrectly?
Steps I took:
- Added the gem omniauth-facebook to my Gemfile
- Ran bundle install in Terminal
- Ran rails g migration AddColumnsToUsers provider uid
- Ran rake db:migrate
- Added the line config.omniauth :facebook, "APP_ID", "APP_SECRET" to the file config/initializers/devise.rb
- Added link to Sign Up on sign up page using the line <%= link_to "Sign In With Facebooks", user_omniauth_authorize_path(:facebook %>
- Added the line devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks} to the config/routes.rb file
- (The part I was confused about) Added a new folder, users, and a new file, omniauth_callbacks_controller.rb (file path is app/controllers/users/omniauth_callbacks_controller.rb) and included code (see Imgur link)
- Added code to the app/models/user.rb file (see Imgur link)