# Help with View/Model

**URL:** <https://www.ruby-forum.com/t/help-with-view-model/107564>\
**Category:** Rails\
**Created:** [June 23, 2007, 9:42am UTC](https://www.ruby-forum.com/t/help-with-view-model/107564 "2007-06-23T09:42:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bxsitecover](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@bxsitecover](https://www.ruby-forum.com/u/bxsitecover)\
**Post date:** [June 23, 2007, 9:42am UTC](https://www.ruby-forum.com/t/help-with-view-model/107564/1 "2007-06-23T09:42:25Z")

</div>

Say you have a model and you scaffold it. You can now create, update,  
delete, show your item. Say I have a limitless amount of records to  
display. I want to keep it like that in the backend, but On my  
frontend I would only like to display 10 items at once, by ID in  
order… but each week I want it to move onto the next 10, until  
oneday it loops back to the beginning. Could someone please help me  
with this? Or suggestions of a more practical approach? Thank you

---

<div class="post-metadata">

**Author:** ![bxsitecover](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@bxsitecover](https://www.ruby-forum.com/u/bxsitecover)\
**Post date:** [June 23, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/help-with-view-model/107564/2 "2007-06-23T17:01:07Z")

</div>

bxsitecover wrote:

> Say you have a model and you scaffold it. You can now create, update,  
> delete, show your item. Say I have a limitless amount of records to  
> display. I want to keep it like that in the backend, but On my  
> frontend I would only like to display 10 items at once, by ID in  
> order… but each week I want it to move onto the next 10, until  
> oneday it loops back to the beginning. Could someone please help me  
> with this? Or suggestions of a more practical approach? Thank you

I assume you generated the scaffold code and you’re not using ‘scaffold  
:model’.

If you just want ten (that is, you don’t want pagination), you could  
write a custom finder in your model. You could take the week number  
since an arbitrary epoch, and multiply to fill out the :offset and  
:limit parameters. Do some math with the number of records and the week  
number to figure out when to start from the beginning again.

I’d suggest googling around for those things. The Rails book (Agile Web  
Development with Rails) is great as well.

Chris K.  
[http://kampers.net](http://kampers.net)
