Forum: Ruby on Rails Passing a browser variable to Rails?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Philip Johnston (Guest)
on 2006-05-24 03:23
(Received via mailing list)
OK so for my first question,

Background :
I am trying to roll my own fuzzy-time representation algorithm.  I want
pull the Timezone from the browser on page load.  I was trying to do it
through javascript, in the form of

"var visitortime = new Date();
document.write("<SOME HTML ELEMENT" +
+ ">");

and once that was written I would pull it into my RoR page loading.  The
reason I'm doing this is that I have some dynamic page calls that need
info without any prior knowledge of the browser (e.g. Trying not to
an account and having the info specified by the user.).

Question :

-Firstly, is there an elegant way to get at the Timezone information of
visiting browser?
-Secondly, I have been looking for documentation about how to access the
from RoR, but can't quite seem to find it.  I keep seeing code segments
"page[:SOME_ELEMENT]" and I'm not sure what this is called.
-Thirdly for future use, is there an elegant way to access the browser
variables(Width, Height, Timezone ...) in general?

Any thoughts?

This topic is locked and can not be replied to.