I have several controllers that are used for specific purposes, and each has a def def function. Like / index uses a homepage and calls an unauthenticated homepage. / jobs / index is different, and / users / index is different. Each of them uses different controllers, such as JobsController, HomeController, UsersController.
My ApplicationController has before_Filter
before_filter :authenticate_user!, :except => [:index]
The problem is that this will also be skipped when I call / jobs / index or / users / index (or any other / * / index page, for that matter). Is there a way so that I can only apply the "/ except" clause to the query "home # index" (for example, HomeController → index page). I tried,
before_filter :authenticate_user!, :except => ["home#index"] but it doesn't work.
Rajat
source share