# REST: Handling homepage and pagination for XML

**URL:** <https://www.ruby-forum.com/t/rest-handling-homepage-and-pagination-for-xml/125023>\
**Category:** Rails\
**Created:** [January 4, 2008, 5:16pm UTC](https://www.ruby-forum.com/t/rest-handling-homepage-and-pagination-for-xml/125023 "2008-01-04T17:16:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [January 4, 2008, 5:16pm UTC](https://www.ruby-forum.com/t/rest-handling-homepage-and-pagination-for-xml/125023/1 "2008-01-04T17:16:49Z")

</div>

Hi you all,

I have two questions regarding a REST app and the XML responses:

- Homepage: I want to have a kind of homepage to list all the list of  
resources the user can access to. I’ve read I can do it with just an  
index.html. However, my app also offers the response in XML so, what if  
the client want the XML? Can I have an index.rxml too? In [1], they  
offer the possibility to have a HomeController to manage this kind of  
singleton resource. What do you think is the best choice?

- Pagination: I have the pagination of my resources managed with  
will\_paginate plugin for HTML responses. How can I do it for the XML  
response? The only option will be doing it by hand (dunno, maybe  
counting the resources, dividing this number by x, being x the number of  
resources I want to list per pageâ€¦and all this in the whatever.rxml  
fileâ€¦this is not quite right). Suggestions?

Thanks.

[1] Leonard Richardson and Sam Ruby, Restful Web Services, O’Reilly.
