Redirect To Specific Page If User Is Not Logged In

Posted By Weston Ganger

In Devise, when you want to authenticate a user before they can access anything in your controller or application you must add this line to your controller:

redirect_to your_path, notice: "Please Login to view that page!" if request.original_fullpath != your_path

Related External Links:

Article Topic:Software Development - Ruby / Rails

Date:October 09, 2015