Closed AndKiel closed 8 years ago
This is a combination of two problems. One is a bug with how the original library parses URLs, the other is an issue with how rails creates asset digests. I submitted a pull request for the first in the original repo. I'll see if I can come up with something for the second.
@AndKiel, try to set svgPath as below:
$('.trumbowyg').trumbowyg(svgPath: '/assets/trumbowyg/images/icons.svg')
it works for me.
@snvl1993, it works in development but in production I get 404.
@AndKiel As long as you are running this code within an erb context you could do something like this:
$('.trumbowyg').trumbowyg(svgPath: '<%= image_path "/images/icons.svg" %>')
It's not very neat but it should get the job done. Once I have some more time I'm going to come back to this and write some sort of migration script that makes the required adjustments automatically on release, but I have no idea when I'll have enough time to do that.
When trying to initialize trumbowyg like that:
$ -> $('.trumbowyg').trumbowyg()
I get:
When I provide any svgPath, for example:
$ -> $('.trumbowyg').trumbowyg(svgPath: false)
it's working (but no icons, just empty buttons).For now a quick solution for me was putting trumbowyg icons SVG file in public/images and providing path as svgPath parameter.