Refreshing data displayed in browser every 24 hrs

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 …

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.

On Jul 16, 8:22 pm, “Pragash Mr.” [email protected]
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 …

Posted viahttp://www.ruby-forum.com/.

I’m sorry but i do not quite understand
Do you want to change data between requests for every 24 hrs, or wanna
refresh data in a 24-hrs-long request?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs