How to add confirm message with link_to Ruby on rails

后端 未结 10 1692
[愿得一人]
[愿得一人] 2020-12-29 17:45

I wanted to add confirmation message on link_to function with Ruby.

= link_to \'Reset message\', :action=>\'reset\' ,:confirm=>\'Are you sure?\'
         


        
10条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 18:25

    <%= link_to 'Reset Message', data: {confirm:"Are you sure?"} %>
    

    remember to add the path, between 'reset message' and data

提交回复
热议问题