Devise sign out issue with rails 7

Devise sign out issue with rails 7

After creating my first rails 7 project, I added devise gem for authentication solution, and there were a couple of issues I faced because of rails 7 changes mainly with turbo streams.

One of that issue is, your regular link for the delete action do not work any more, one of example is devise sign out link:

<%= link_to "Sign out", destroy_user_session_path, method: :delete %>

Or any other link where you are using method: :delete. Now that rails 7 ships turbo streams by default, you need to make these links compatible with turbo streams by following changes:

<%= link_to "Sign out", destroy_user_session_path, data: { turbo_method: :delete } %>

with this subtle change sign out link should work again!

Happy Coding!!