Add Devise gem to handle authentication in rails app

Total Blog Views: 49

Blog Status: publish

Created By: asad_fazlani Created at: 08-14-2021

Tags: bootstrap-typeahead-rails devise gem authentication

How to Add Devise Gem in rails app step by step guide:

first we need to understand what is Devise. In every application we need sign_in , sign_up functionality. Devise gem solve this problem to develop manually above functionality. 

result of this blog:

 

Getting starting with devise :

Add the following gem to gemfile

gem 'devise'

then run bundle 

Next you need to generate devise using below command:

rails generate devise:install

then run below commad , this commad willl create model.

rails generate devise user

if database is not created then create database using rake db:create and after rake db:migrate.

otherwise only migrate using rake db:migrate

You can copy Devise views (for customization) to your app by running:

rails g devise:views

And finally we succefully created on of the important feature of application. in which user should be able to sign in ,sign out ,sign up securely.

 

 


asad_fazlani

Technical Blogger at shadbox



Comments



  • shahdabansari | almost 4 years ago
    nice information
    • asad | almost 4 years ago
      Thank you
  • swazahmad | almost 4 years ago
    Awesome Information Thanks For Sharing
Buy traffic for your website

About Shadbox

we have the “Get things executed” lifestyle at our place of work. There are not any excuses, no if’s or however’s in our dictionary. committed to navigating the ship of creativity to create cell answers, we resolve the real-lifestyles troubles of our clients and their clients. Our passion for work has won us many awards, year after 12 months.

Services

Downloads