Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 23rd, 2012  |  syntax: None  |  size: 0.33 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do I use ruby time class to always get the EST
  2. $j(document).ready(function() {
  3.   refresh();
  4.   function refresh() {
  5.     $j.getJSON("/timer", function(data) {
  6.       console.log(data);
  7.     });
  8.     setTimeout(refresh, 3000);
  9.   }
  10. });
  11.        
  12. def refresh_timer
  13.   respond_to do |format|
  14.     format.json { render :json => Time.now}
  15.   end
  16. end