render partial on click

前端 未结 3 1020
醉梦人生
醉梦人生 2020-12-24 04:15

I would like to call partials on some standard operations. I am using this method for calling the partial:

 %li= link_to \'Delete Event\', \'javascript:void(         


        
3条回答
  •  清歌不尽
    2020-12-24 04:23

    To add to the accepted answer, I only got it to work after changing the js portion to the following:

    $('#div_id').html("<%= escape_javascript(render :partial => 'my_partial') %>");
    

    Without the escape_javascript it was just rendering the partial in the background and not updating the view.

提交回复
热议问题