ruby on rails - How can I use image_tag in a javascript response? -


i'm trying realize following:

$(".share-icon").html("<%= image_tag(@card.photo.url(:small)) %>"); 

this not working how can use image_tagin js response?

thanks

try escaping html generated image_tag using escape_javascript

$(".share-icon").html("<%= escape_javascript image_tag(@card.photo.url(:small)) %>"); 

Comments

Popular posts from this blog

xslt - Substring before throwing error -

Google Cloud Bigtable Durability/Availability Guarantees -

Android M doze mode and "native" posix socket freezing up -