Created
June 14, 2012 22:49
-
-
Save agibralter/2933494 to your computer and use it in GitHub Desktop.
rabl pagination without object roots?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @object is a paginated array of questions | |
collection @object, root: 'collection', object_root: false | |
attributes :question_text, :created_at, :updated_at | |
#=> {"collection": [{"question_text": "foo bar", "created_at": "...", "updated_at": "..."}, {...}, {...}]} | |
# I want this: | |
#=> {"collection": [{"question_text": "foo bar", "created_at": "...", "updated_at": "..."}, {...}, {...}], "page": 1, "total_pages": 10} | |
# glue? node? wtf? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment