ruby - Rails association with "root" params -


what best way found "root" params of called method in rails?

user.first.comments # => [#<comment id: "1", name: "first comment" ... 

and need this:

user.first.comments #<user id:1, name:"first user", comments: [   #<comment id: "1", name: "first comment" ..., #<comment ... ] 

needed serialization.. thank you.

you know, problem has nothing includes. whether user's comments retrieved n + 1 query or not irrelevant.

i think need rabl. i've used , it's awesome.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

node.js - Bad Request - node js ajax post -

uitableview - Create and use custom prototype table cells in xamarin ios using storyboard -