I have a query something like this in my controller that I am passing it as JSON to JBuilder,etc.... But JBuilder shows nothing! it just shows { }
@students = Students.top_students.joins(:program).where("programs.organization_id = ?", params[:id]).limit(10)
So before it gets to there I just wanted to make sure it is getting the correct data, its joins are correct, etc.. So can I do that?
If I just say puts @students
it will print something like, I want to see what is inside each of them.
#<Student:0x007fd33ebe57a8>
#<Student:0x007fd33ebe4d08>
#<Student:0x007fd33ebe3ea8>