I'm running a RoR survey application that randomized question/answer order on a page using something like: answers.sort_by{rand}
This happens on several pages, each generating its own random number (in the view).
This sets the order on page render. It works fine on my local machine in both production and development mode running Mongrel, but doesn't work on my production server running Litespeed 4.0.3 (or 3.3 before that).
Strangely, when I restart the server, the value of rand appears to change. But it's the same for every page.
So it seems like this is some sort of caching problem where rand is only getting generated once.
Any ideas?
Thanks!
This happens on several pages, each generating its own random number (in the view).
This sets the order on page render. It works fine on my local machine in both production and development mode running Mongrel, but doesn't work on my production server running Litespeed 4.0.3 (or 3.3 before that).
Strangely, when I restart the server, the value of rand appears to change. But it's the same for every page.
So it seems like this is some sort of caching problem where rand is only getting generated once.
Any ideas?
Thanks!