I have a couple of methods being fired by each request by before_filter. I’ve tried putting these methods in several places but ended up using them in a file under lib and that being the only way that worked. Where is the correct place to put these methods? Ideally I’d like to automatically have these accessible to every controller w/o including anything else.
Share
You can put the methods used by several controllers in the
ApplicationController. If most requests must execute thisbefore_filter, put it also in theApplicationController, and you can ignore the filter for specific actions withskip_before_filter. An example is available here.