question about putting code in application.rb...

If you want this functionality in all controllers, then it should go in application.rb.

If you want it in only some controllers but not others, you could create a new controller

class AdminController< ApplicationController

before_filter :admins_only


Then inherit from that instead

class SomeOtherController < AdminController


You could also experiment with using modules to share code between controllers.