Jeff DAVIS
Jeff DAVIS

Reputation: 25

escape_javascript not working in rails 3.2.7

In application.js:

$(document).ready(function() {
    var After = 5000;
    var refreshId = setInterval(function() {
        $("#test").html("<%= escape_javascript(render_cell :test, :display) %>");
    }, After);
});

This is supposed to render the cell...But what it gives me in the browser is this: <%= escape_javascript(render_cell :test, :display) %>

Rails did not interpret the ruby part...It just gives it back as plain text...

What could be wrong?

Upvotes: 1

Views: 431

Answers (1)

JohnMerlino
JohnMerlino

Reputation: 3928

did you mean application.js.erb?

JavaScript doesn't know ruby.

Upvotes: 1

Related Questions