how to include cropperjs library in rails6 using the webpacker

Viewed 137

I want to add the cropper functionality using the data modal, but I could not even select the file from the data modal. I tried using the yarn install command and webpacker but javascript is not adding to the corresponding page.

1 Answers

Add the cropperjs using yarn's add command and then import your necessary functions from the node_modules you have installed. Also, include CSS files from the node_modules, otherwise there might be some issues related to the styling.

Related