ruby on rails - erb in jquery causing "Uncaught SyntaxError: missing ) after argument list" -


i'm using erb appended page through jquery. page works fine when take erb out (the image_tag), doesn't load in. adding in correctly?

the error in console i'm getting is:

uncaught syntaxerror: missing ) after argument list 

code sample:

        $('#stops').append(           "<div class='bus-item-header col-xs-12'>" +              "<%= image_tag('compass.png') %>" +             "<h2>" + stop.monitoredvehiclejourney.publishedlinename +              "</h2>" + "<br>" + "<span class='line-info'>"+              currentstopoba.name + "<br>" +              "to: " + busdestinationregex + "<br>" + "<br>" + "</span>"             + "</div>" +            "<div class='bus-item col-xs-12'>" + busdistanceaway + "<br>" +             busstopsaway + " stops away" + "<p>" + "</div>"          );         

any , appreciated!

image_tag returns img tag has double quotes in it. work, need escape quotes.

<%= j image_tag('compass.png') %> 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -