やりたいこと
クリック後にボタンを無効化し、こんな感じで処理中のアニメーションをボタンに表示したい。
| 検索中|
|:---:|
環境
- Rails 4.2.1
- jQuery UJS
- FontAwesome
RailsでHAML
= f.button "検索", data: { disable_with: "<i class='fa fa-spinner fa-spin'></i>検索中" }
HTML
<button name="button" type="submit" class="submit"
data-disable-with="<i class='fa fa-spinner fa-spin'></i> 検索中">
検索
</button>