The last Rails app I created, OurGroceries, was made to mess around with and learn Hotwire. Hotwire is by far a super nift and amazing piece of technology, used to create reactive and real-time applications in Rails without the need for a SPA/SPA-like JavaScript Framework. OurGroceries is super simple, and honestly HotWire is probably overkill for it, but it was a learning project, not some fancy SaaS app I’m trying to make money off of.
However, when I was close to the finish line, I ran into a very odd error, I couldn’t get the password reset form to work. I would follow the link generated in the email, type in a new password, then nothing changes, and I would still be on the reset password form page with the form still filled out. The following errors would be in the logs:
|
|
I wound up posting on the rails subreddit, and some wonderful stranger pointed me in the right direction. They stated: That 'as TURBO_STREAM' pops out at me. I'm not sure how Devise and Turbo play together
and linked me to a StackOverflow post that I somehow missed in all my hours of googling.
The fix was super straightforward and simple, it’s actually a known issue with Devise with a PR open for it. All I needed to do was add html: {'data-turbo' => "false"}
to the form_for
in the forms that were giving me problems, and then everything started working!
This is my first blog post on trying to explain a fix or technical issue, so I’d love feedback! Hit me up on the twitters at @thisisdylandev
Well, that’s all for now 👋