I implement the following code in my rails application.js file. When the user clicks on the link, the view reloads with a complete list of reviewers instead of the first 4:
$(document).ready(function(){
$("#more_reviewers").click(function(e){
$("#reviewer_list").html('<%= escape_javascript(render "restaurants/restaurant_reviewer_list", :venue => @restaurant, :limit => @restaurant.reviews.count) %>');
});
});
Problem: instead of showing me the list, the code returns the Rails code as text. So on my screen, instead of seeing a list of users, I see:
'<%= escape_javascript(render "restaurants/restaurant_reviewer_list", :venue => @restaurant, :limit => @restaurant.reviews.count) %>'
This is probably going to be a simple one - and I'll appreciate it.