Save 36% for Black Friday! Learn more

New Discussion

Notifications

You’re not receiving notifications from this thread.

Auto-detect User Time Zones in Rails Discussion

6
General

Great video Chris, time zones can be extremely frustating to work with. I would caution against setting time zone in a before action across all controllers. I did something similar and ended up in a default scope sort of situation where it was helpful but then I had to selectively turn that off for a lot of requests.

I guess your time zone was leaking outside of your controller actions. A common way to solve this would be to use around_action instead of the before_action.

in my app around_action yields no html view somehow.

another well explained video! I have been struggling with how to handle timezones for some time now!

Which video? Can you share the link?

Join the discussion
Create an account Log in