rails 4 bootstrap 3 ajax modal

前端 未结 2 1927
礼貌的吻别
礼貌的吻别 2021-02-05 17:04

I\'m busy learning Rails 4 and I would like to display a bootstrap popup modal when a user clicks on a link, when the modal opens it needs to show the information relating to th

2条回答
  •  醉梦人生
    2021-02-05 17:54

    You also need to show the modal, add $('#myModal').modal('show') in show.js.erb

    $("#myModal").html("<%= escape_javascript(render 'modal') %>");
    $('#myModal').modal('show')
    

提交回复
热议问题