I have a note class that belongs to a user (ie a user can create many notes).
clip from my notes controller
class NotesController < ApplicationControl
Would it be possible to do it the other way around?
def index @user = User.includes(:notes).order("created_at DESC") respond_with @user end
It would be expensive to include user objects each time the @notes is iterated.
@notes