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 Kampmeier
http://kampers.net
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---