I have an array of objects. I want to be when you click on the link, I came through all the objects and displays them on the page, at using ajax
run.js.erb
$(function(){
$("#next").click(function(){
$.post(<%= EngineHelper.nextQuestion %>, function(data){
$("#question").html(data);
});
return false;
});
});
But it does not work. in the script instead of <% = EngineHelper.nextQuestion%> substituted the current data array element. and I need to display the next array element