Closed cpanderson closed 7 years ago
Hello,
I'm having trouble with the confirm dialog (data-confirm) for a delete method. I have...
resources :users
..in my routes file. I have an edit action/view and an index action/view. If I put the link on the my index page...
link_to user_path(user), method: :delete, data: {confirm: 'Are you sure you want to delete this user?'}
...I get a dialog box to Ok or Cancel. If I press Cancel I'm redirected to the edit page instead of the dialog just closing.
Any insight as to why Cancel needs to redirect and how to fix it would be appreciated.
Ugh. Nevermind. My bad.
Hello,
I'm having trouble with the confirm dialog (data-confirm) for a delete method. I have...
resources :users
..in my routes file. I have an edit action/view and an index action/view. If I put the link on the my index page...
link_to user_path(user), method: :delete, data: {confirm: 'Are you sure you want to delete this user?'}
...I get a dialog box to Ok or Cancel. If I press Cancel I'm redirected to the edit page instead of the dialog just closing.
Any insight as to why Cancel needs to redirect and how to fix it would be appreciated.