0

Working on a Rails app using slim. I have a problem passing html to slim on a button using data-disable-with attribute. I would like to show the icon on the button when someone clicks.

 = f.submit t("basket.next_step"), class: "btn btn-warning btn-lg btn-block", id: "submit_form", data: { disable_with: "<i class='fa fa-spinner fa-spin'></i>..."}

I have tried .html_safe but no luck. Please see similar questions but in .erb How to set html on data-disable-with to rails submit_tag and How to render HTML inside Slim templates for options i have tried.

Any help is greatly appreciated.

Community
  • 1
  • 1
Benjamin
  • 2,108
  • 2
  • 26
  • 46

1 Answers1

1

Try changing f.submit to f.button. The button tag handles markup differently than the submit tag.

jeffdill2
  • 3,968
  • 2
  • 30
  • 47