You could do it with AJAX as well and store it in a session variable...

# routes.rb
post "timezone/set"

# timezone_controller.rb
def set
  session[:timezone] = params[:timezone]
end

# application_controller.rb
before_filter :set_timezone 
def set_timezone 
  Time.zone = session[:timezone]
end 

# detect_timezone.js
$.post("/timezone/set", { timezone: 
jstz.determine_timezone().timezone.olson_tz } );

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/Cn3QsKz_pBAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to