0

How do I render a js.erb file after HTML in a HTML request?

4

1 回答 1

1

I would put a call in a .js or coffee file in the assets/javascripts folder.

$(function() {
    $.getScript(location.href);
}

You'd probably want to add some conditional logic unless there's a .js.erb file for every url.

于 2012-05-24T14:31:23.207 回答