KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have this template: # app/views/posts/index.rabl collection @posts => :posts attributes :id, :title, :subject child(:user) { attributes :full_name } node(:read) { |post| post.read_by?(@user) } Witch returns: { "posts": [ { "post": { "id": 5, "title": "...", "subject": "...", "user": { "full_name": "..." }, "read": true } } ] } And I would like to add to add some pagination params in order to rendering this: { "posts": [ { "post": { "id": 5, "title": "...", "subject": "...", "user": { "full_name": "..." }, "read": true } } ], "total": 42, "total_pages": 12 } Any ideas? Many thanks!
Tags (comma-separated)
Save Edits
Cancel