Here’s the code:
class SyncController < ApplicationController
def get_sync
@passed_ids = params[:ids].split(',')
@users = @passed_ids.collect{|id| User.find(id)}
#add the current user to the list
@users << current_user
@recommendations = get_recommendations(@users)
end
end
module SyncHelper
def get_recommendations(users)
users
end
end
I’m getting a can’t find get_recommendations method error…
Your
SyncHelpermodule needs to be included into yourSyncControllerclass. You can either add the linein your class definition, or, if
SyncHelperlives in the expected app/helpers file, you can use the rails helper method.