inline_svg
inline_svg copied to clipboard
Display from Active Storage
I have disabled Active Storage from displaying the image as a blob by adding an initializer with the following:
Rails.application.config.active_storage.content_types_to_serve_as_binary.delete('image/svg+xml')
However, I am still unable to do something like the following <%= inline_svg_tag product.product_icon, class: 'h-6 w-6', aria: { hidden: true } %> without an error being thrown. Not entirely sure what I am doing wrong.
Could you paste in the error you're seeing? 🤔
@richjdsmith Did you get it to work?
Same thing happening here. If I use url_for(user.avatar) I get the empty SVG with the file not found error (and the path it shows is actually correct); if I just do user.avatar I get undefined method 'start_with?' for #<ActiveStorage::Attached::One:0x000000010cc8d540>.
Any ideas?
@richjdsmith Did you get it to work?
Nope. Implemented a dirty fix myself, but never did love how I did it. If I have time I'll track it down and try to do a pull request.
@richjdsmith did you manage to track down your dirty fix? Would be good to see how you've done it at least