Skip to main content

How do I integrate the local_time gem without using the asset pipeline?

Gems / Libraries • Asked by Michael Raeford

How do I add the local_time gem to my project without using the asset pipeline as shown in one of the tutorial videos on building a user forum (https://gorails.com/episodes/forum-time-zones-with-local_time?autoplay=1). More specifically, how do I add the local-time.js file to my app using the local_time gem, but not use the asset pipeline to do it? I see an option to add it using the npm package (see below) but I am not sure how this works and where to put it.

import LocalTime from "local-time"
LocalTime.start()

Please advise.

MDR


If you use the gem, you have to use the asset pipeline for it. This is what I would recommend anwyays. The asset pipeline is perfect for these things. Any reason why you're avoiding using the asset pipeline?


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 22,346+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.