From: Max Williams Date: 2008-07-16T22:12:17+09:00 Subject: Re: Refreshing data displayed in browser every 24 hrs Pragash Mr. wrote: > Hi, > I want to refresh the data which is displaying in browser for every 24 > hrs is there any solution..... > plz reply > > for ex: firstname i am displaying in browser i want to change the > firstname every 24 hrs ...... I had that same problem and did it like this: basically, i mod 'days since epoch' over array size to get an array index that changes every day. #get a list of possible resources to choose from, eg @resources = Resource.find(:all) days_since_epoch = Time.now.to_i/86400 @resource_of_the_day = @resources[days_since_epoch % @resources.size] It means that @resource_of_the_day effectively changes at midnight (server time) with no need for scheduled tasks or anything like that. -- Posted via http://www.ruby-forum.com/.