Let's say I have an index.js.erb file that gets called remotely. How would I render a partial with a collection and then have jQuery display it on the page.
I'm thinking something along the lines of this (that actually works):
开发者_StackOverflow$('#eventlist').html("<%= escape_javascript(render :partial => \"memorylist\", :collection => @memories) %>");
Looks good to me. Only thing I might change is using single quotes on the inside to make it a little more readable:
$('#eventlist').html("<%= escape_javascript(render :partial => 'memorylist', :collection => @memories) %>");
精彩评论