Answer the question
In order to leave comments, you need to log in
How to render svg code in the controller so that it is available through the tag?
I have an svg image code in my controller. How to render so that the image can be used in the tag?
def render_image
html="<code_my_svg_image>"
respond_to do |format|
format.svg {
render inline: html.to_s, content_type: 'image/svg+xml'
}
end
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question