RailsTip 3 – Configure sign_out method in Rails Devise Gem


Devise gem is one of the most popular gem for creating user login and signup.

The /logout action is by default set to :DELETE inside devise.rb . Most of the browsers only support :GET and :POST.

To change the method of /logout to :GET make following changes in devise.rb

config.sign_out_via = :get

Cheers !!

Rails Devise Gem , customize the sign_in path


While using devise gem , once the user logs in successfully , by default it gets redirected to the home page set in routes.rb via “root” . To redirect it to different page , add following code inĀ ApplicationController class


def after_sign_in_path_for(resource)
 "/welcome" #your custom page
end