user2950593
user2950593

Reputation: 9647

Gem devise getting started?

I am using this tutorial https://launchschool.com/blog/how-to-use-devise-in-rails-for-authentication But i am a little bit confused. I want to make simple app to see how devise works So far I did this: Added devise gem. then ran

rails generate devise:install     # Creates config file, etc.
rails generate devise user        # Create model class, routes, etc.
rake db:migrate                   # Create user table
rails generate devise:views users # Creates (minimal) views

My routes.rb file has devise_for :users What are my next steps? If I go to http://localhost:3000/users/signin or http://localhost:3000/signin It says no routes are defined

Upvotes: 0

Views: 187

Answers (1)

Albert Paul
Albert Paul

Reputation: 1218

Default signin and sign out links are,

http://localhost:3000/users/sign_in

and

http://localhost:3000/users/sign_out

To see what your current routes are, try following in console,

rake routes

To generate signout link in view, add following,

<%= link_to 'Sign out', destroy_user_session_path, :method => :delete %> 

Upvotes: 2

Related Questions