# Ranges in RESTful resources

**URL:** <https://discuss.rubyonrails.org/t/ranges-in-restful-resources/20043>\
**Category:** rubyonrails-talk\
**Created:** [November 4, 2007, 10:41am UTC](https://discuss.rubyonrails.org/t/ranges-in-restful-resources/20043 "2007-11-04T10:41:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evgeni\_Dobrev](https://avatars.discourse-cdn.com/v4/letter/e/edb3f5/32.png) [@Evgeni\_Dobrev](https://discuss.rubyonrails.org/u/Evgeni_Dobrev)\
**Post date:** [November 4, 2007, 10:41am UTC](https://discuss.rubyonrails.org/t/ranges-in-restful-resources/20043/1 "2007-11-04T10:41:14Z")

</div>

Hi,

I am writing an application with nested resources. I have a resource called Facilities which has\_many Reservations.

map.resources :facilities do |facilities| &nbsp;&nbsp;facilities.resources :reservations end

I have thus urls like

/facilities/1/reservations /facilities/1/reservations/4

I have the possibility to show a list of all reservations - the index action, and a particular reservation - the show action. How do I list all reservations between 10. April 10:00 and 12. April 20:00 ?

How do I list ranges in RESTful resources?

Cheers,

evgeni

---

<div class="post-metadata">

**Author:** ![Evgeni\_Dobrev](https://avatars.discourse-cdn.com/v4/letter/e/edb3f5/32.png) [@Evgeni\_Dobrev](https://discuss.rubyonrails.org/u/Evgeni_Dobrev)\
**Post date:** [November 5, 2007, 7:54am UTC](https://discuss.rubyonrails.org/t/ranges-in-restful-resources/20043/2 "2007-11-05T07:54:00Z")

</div>

Hi Gerjan,

thank you for your proposal. Sounds really streightforward. Is this approach along the RESTful lines? I have read the following discussion:

[http://groups.google.ca/group/rubyonrails-talk/browse\_thread/thread/e1759be395695179/2cd53b5742b7bec2](http://groups.google.ca/group/rubyonrails-talk/browse_thread/thread/e1759be395695179/2cd53b5742b7bec2)

I have been thinking about my problem for a couple of days now and I still think there should be a simpler solution. Maybe ranges should be treated as another resource. But then they share the same set of data with the index action. Sounds like a "2 Controller-one Model-thing" DHH was talking on the Eurocon about. Hmm ...

Cheers,

evgeni
