rails 7 link_to delete method not working

Viewed 44
<%= link_to "Destroy", article_url(article), data: {  turbo_method: :delete,  turbo_confirm: "Are you sure?"} %>

its generated wrong link but after rebooted PC it generate proper link:

<a data-turbo-method="delete" data-turbo-confirm="Are you sure?" href="http://localhost:3000/articles/6">Destroy</a>

but rails somehow still redirect to show, not to delete controller I tried replace it by

<%= button_to 'delete', article_url(article), method: :delete,
                form: {data: {turbo_confirm: "are you sure?"}} %>

its work, except confirmation does not appear. I think problem with turbo, when i generate project i used: rails new lenglish -c bootstrap i just start write project and there are only CRUD for article, and header, footer, github: https://github.com/kukla1989/lenglish. Will be very appreciative for any help and pardon for my poor choice of words.

1 Answers

as i mentioned in question problem was in turbo, after i ran server with command bin/dev everything becomes work fine

Related