I need to pass a variable js to rails, as a parameter, but it is not working. Here is my code:
#function js
function load_custom_fields(){
var id = $("MY_SELECT").val();
$(".productHere").html("<%= escape_javascript(render :partial =>'my_partial', :locals => { id:id} ) %>");
}
$(".productHere").html("<%= escape_javascript(render :partial =>'my_partial', :locals => { id: " + id + "} ) %>");