Reputation: 2960
I'm trying to realize following:
$(".share-icon").html("<%= image_tag(@card.photo.url(:small)) %>");
This is obviously not working but how can I use image_tag
in a JS response?
Thanks
Upvotes: 0
Views: 641
Reputation: 29599
try escaping the html generated by image_tag
using escape_javascript
$(".share-icon").html("<%= escape_javascript image_tag(@card.photo.url(:small)) %>");
Upvotes: 2