Skip to main content

Devise sign out issue with rails 7

Updated 1 min readMarkdown
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!!

About the author

  • I am a full-stack Ruby on Rails developer with experience in PostgreSQL, Docker, Heroku, and performance optimization. I love exploring new technology stacks and have recently developed an interest in mobile app development using Flutter. My skills in test-driven development and fixing security vulnerabilities have helped me deliver high-quality, reliable code. I am also currently learning about machine learning and its applications in real-world problem-solving. I bring a unique combination of technical expertise, creative problem-solving, and a passion for learning to any team. I am committed to delivering elegant and efficient software solutions and excited to contribute to an innovative and dynamic team that shares this vision.

No comments yet. Be the first to comment.

More from this blog