Rendering a partial using AJAX
$('#next_videos').replaceWith('<%= render(:partial => 'videos')%>');
is my js
the partial im rendering i dumbed down to isolate the problem
<p> Testing </p>
so this works fine but when you add any ruby comments e.g.
<p> Testing </p>
<%# holder = videos_counter %>
nothing happens. The server shows that it processes it fine but no changes occur on the web page. Any clue as to what’s going on here? Thanks.
Using rails 3.1.1, sqlite3, formtastic 2.0.2, devise 1.5.1, and whenever
Edit:
The AJAX update isn’t working when there is more than one line in my partial. For example,
<p> Testing </p> <p> Testing </p>
will work but
<p> Testing </p>
<p> Testing </p>
will not.
You may try escaping the markup using the escape_javascript helper or its
jalias: