ruby on rails - How do I use Turbolinks and local_time together? -


i've noticed recently, since installing rails 5 local_time gem doesn't work on pages link internal (through turbolinks). if link page external or browser refreshed, or turbolinks disabled, local_time works properly.

does know how use these together?

i needed initialize local time on turbolinks load. event provides chance things have run @ document ready. javascript is:

document.addeventlistener("turbolinks:load", function() {   localtime.run(); }); 

Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -