How about selecting a range based on the day of month (so you can show
a different subset of @links based on what week of the month you''re
in).
Something like:
case Time.now.day
when 1..7
range = 0..10
when 8..14
range = 11..20
when 15..21
range = 21..30
else
range = 31..50
end
<% @links[range].each do |link| %>
- Ben
http://www.ticketi.sh/
Simple Help Ticket Tracking for People Who Want Less
On 6/13/07, bxsitecover
<raymondbaker85-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:
...> What I want to do is display 10 links at a time out of (50+ links)
> And be able to rotate the links on a weekly basis, and display that in
> a partial.
>
> Can anyone help me with this timed loop to display 10 links at a time
> from my db? Or refer me to a chapter in a rails book. Thanks!
...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---