I need to define some common piece of code that can be invoked from different controllers(not view). Is there a way to do that in Rails v3?
I have defined the code in ApplicationHelper and tried to invoke it using
@template.<helper_method>
and
ActionController::Base.helpers.<helper_method>
But it does not work?