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
Post a Comment