Include associated model when rendering JSON in Rails

Something like this should work:

render :json => @programs, :include => {:insurer => {:only => :name}}, :except => [:created_at, :updated_at]

Leave a Comment