@song.likes.select('likes.*, users.*').includes(:user).to_json
Only converts the like objects. Is there a way to include the user objects in the json result? Via Ruby or other.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Would do what you want.
In Rails-JSON you have to explicitly specify which associations get traversed to prevent too deep object trees and circular references.