Fix Devise Turbo Stream responses for flash messages
Wire Users::DeviseController as Devise parent controller with the Turbo-aware responder, so failed form submissions (login, password reset) render correctly as HTML with 422 status instead of unprocessable turbo-stream content that Turbo silently drops. Also fixes a NameError in the responder (rendering_options -> error_rendering_options) and removes the dead TurboController.
This commit is contained in:
@@ -6,7 +6,7 @@ class Users::DeviseController < ApplicationController
|
||||
if get?
|
||||
raise error
|
||||
elsif has_errors? && default_action
|
||||
render rendering_options.merge(formats: :html, status: :unprocessable_entity)
|
||||
render error_rendering_options.merge(formats: :html, status: :unprocessable_entity)
|
||||
else
|
||||
redirect_to navigation_location
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user