Posts Tagged ruby gem

Timezones in Rails

Many people would have had problem with time zones and might have written messy code for it. Well no more. There is an excellent gem called browser-timezone-rails . All you have to do is this in your gem file include the gem in your Gemfile


gem 'browser-time-zone-rails'

Then bundle to install the gem


$ bundle install

Then in your aplication.js file add this line

//= require browser_timezone_rails/application.js

Restart your app and enjoy the magic!

Advertisements

, , , ,

Leave a comment