Inline_svg gem not working. SVG file not found

Viewed 2273

I'm running rails 5.0.1 and using last version of inline_svg gem : Inline SVG

The issue is that even if I put my svg with the right path like this :

<%= inline_svg "/assets/svg/add.svg", class: 'some-class' %>

And the image is located in "app/assets/svg/add.svg".

I get this error on the browser :

<!-- SVG file not found: '/assets/svg/add.svg' -->

I think he could because svg are not correctly load by rails but I didn't see any information on that on google.

2 Answers

It will work if you just store the SVGs in app/assets/images/svg and call <%= image_tag 'svg/add.svg' %>

Related