Hi, I am creating an api section for an application. My all API-related controllers are inside the app/controllers/api directory.
I am worried that there is a filter before_action :authenticate_user! in application_controller before_action :authenticate_user! so I have to be in login mode in order to access the api.
My current solution: I add skip_before_action :authenticate_user! to all controllers that are in app/controllers/api .
Problem: I have to write in all controllers, and I have about 80 controllers
My expectation: Is there a way in which I can write to application_controller , something like this before_action: authenticate_user !, except: [ all the controllers which are in api directory ]
source share