This method should be in ApplicationController and you should mark if as helper (as I know there is one already, then only mark her as helper)