If you want to check if the user is signed for each action in the application, you must place the filter in the application controller. You can do this for a specific controller.
You can use the devise method:
class SomeController < ApplicationController before_action :authenticate_user! ... end
You can also create your own filter:
class SomeController < ApplicationController before_action :my_authentication ... def my_authentication if user_signed_in?
source share