I'd highly suggest you check out the jbuilder gem. There's a great railscast that explains it's usage.
Basically, you will have to add a jbuilder file into your views, that gives you allot more control over your json.
For your specific use case you'd use something like this:
doctors/index.json.jbuilder
json.doctors @doctors do |json, doctor| json.(doctor, :id, :name) json.reviews doctor.reviews do |json, review| json.(review, :id, :rating, :patient_profile_id) json.patient_profile review.patient_profile do |json, profile| json.(profile, :id, :name, ... ) # attributes of the profile end end end