In my Rails application I have this:
class ProjectsController < ApplicationController
include ApplicationHelper
def index
@payments = current_user.projects.custom_order
end
...
end
module ApplicationHelper
def custom_order
order("name ASC")
end
end
However, in my index
view I get this error:
undefined method 'custom_order' for #<Class:0x007f8be606ff80>
How can this be done?
I would like to keep the custom_order
method in a helper module because I am using it across various different controllers.
Thanks for any help.