escape_javascript not working in rails 3.2.7

438 Views Asked by At

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?

1

There are 1 best solutions below

1
On BEST ANSWER

did you mean application.js.erb?

JavaScript doesn't know ruby.