How to add bootstrap modal with link_to so the link content open in modal ?

后端 未结 3 654
死守一世寂寞
死守一世寂寞 2020-12-01 04:09

I am trying to use bootstrap modal http://twitter.github.com/bootstrap/javascript.html#modals on a rails link to open that link in the modal

<%= link_to          


        
3条回答
  •  死守一世寂寞
    2020-12-01 04:38

    There is a prettier way to add data attributes in Rails. You can do something like this to get the same results.

    <%= link_to 'Click Here', "#", data: {toggle: "modal", target: "#modal"} %>
    

提交回复
热议问题