How to set html on data-disable-with to rails submit_tag

前端 未结 4 1077
独厮守ぢ
独厮守ぢ 2021-02-04 00:15

I have a RoR app using bootstrap. I\'m trying to apply the fontawesome html icon tag to a submit_tag helper, but it does not seem to be supported. When I click submit, the disa

4条回答
  •  日久生厌
    2021-02-04 00:46

    A quick tip on generating a button_to with html_safe and disable_with:

    <%= button_to some_path, method: :post, class: 'btn btn-md btn-primary', "data-disable-with": ''.html_safe do %>
      
    <% end %>
    

提交回复
热议问题