2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

削除ボタンを押したら、確認ダイアログを出そう。 ❏Rails❏

Last updated at Posted at 2019-12-03

data: { confirm: "削除しますか?" }を追記

xxx.html.haml
= link_to "削除", path, method: :delete, data: { confirm: "削除しますか?" }

最後に加えればOK!
めっちゃ簡単に確認ダイアログが作成できた!嬉しい!!


ではまた!
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?