I\'m looking to render an index of all articles along with a full article via JSON in my rails app, but I\'m having a little trouble figuring out how to do it.
Here
Thanks for the question, I am able to customize my json format for a model with several associations.
render json: @posts.to_json(
:except => [ :created_at, :updated_at, :user_id ],
:include => {
:user => {:only => [:email, :phone]},
:location => {:only => [:title, :lat, :lon, :street, :city, :state, :zipcode]},
:uploads => {:only => [:image]}
}
)