will_paginate
will_paginate copied to clipboard
Pagination in API? (to_xml, to_json)
I found a mention in an old lighthouse post about a to_xml method on a pagination collection, but I can't seem to find it anywhere in the source.
Is this something that's been done? is there a reason NOT to write a patch to do this?
Thanks! Andrew.
Not been done. The reason why this hasnt been solved yet is because building XML/JSON responses from web applications is often application-specific and sometimes even handled by 3rd-party plugins such as AM Serializers. There is no single place where I can make code for this that can benefit everyone.
Anyone who solved this problem in their application is welcome to share their solution here and propose ways in which it can be helpful to other people.