Importmaps

Santhosh Narayana Santhosh Narayana posted on 2024-01-19 09:09:02 UTC

I am referring to the full calendar integration videos. It seems that the videos are not up to date for Rails 7 using importmap. Is there any video/blog I can refer to for this? Thanks

David Kimura PRO said 11 months ago :
I'll look into this to see if anything has changed with Importmaps in the past few months. However, the last time I looked, there's a lot of "going against the grain" with importmaps when it comes to javascript libraries that also provide their own CSS. My initial thought is that you would still need to use Yarn to also bring in those libraries so that you can consume the CSS.

Santhosh Narayana said 11 months ago :
thanks David

Santhosh Narayana said 11 months ago :
Hi David,
I am trying to follow https://www.driftingruby.com/episodes/fullcalendar-with-stimulusjs?query=full+calendar. As I am in Rails 7 I am using importmap. I am trying to pin the files in node_modules (yarn)  using the below but it doesn't work.

pin "@fullcalendar/core", to: "./node_modules/@fullcalendar/core"
pin "@fullcalendar/daygrid", to: "./node_modules/@fullcalendar/daygrid"
pin "@fullcalendar/interaction", to: "./node_modules/@fullcalendar/interaction"
pin "@fullcalendar/timegrid", to: "./node_modules/@fullcalendar/timegrid"

Do you have any suggestions? I wanted to use fullcalendar in my project but none of the fullcalendar videos are working for me. Thanks

Santhosh Narayana said 11 months ago :
I made this work. Thanks David.

David Kimura PRO said 11 months ago :
I'm glad you were able to figure out a solution, would you mind posting it in case it helps someone else?

Login to Comment
Back to forums