This gist is relevant while this Devise issue#5446 is not closed or a better solution is not suggested.
Not getting flashes errors using turbo.
1. Override FailureApp and devise parent controller.
Since I'm using simple_form in my project,
I decieded to override simple_form_form
with this special options.
module SimpleFormHelper
def devise_form_for(object, *args, &)
form_options = { data: { turbo: false } }
options = args.extract_options!.dup
simple_form_for(object, *(args << options.merge(form_options)), &)
end
end
And I can replace in all my devise views simple_form_for
with devise_form_for
. It will work just fine.
# <%= simple_form_for(resource, url: user_session_path) do |f| %>
<%= devise_form_for(resource, url: user_session_path) do |f| %>
<%= f.input :email, required: false, autofocus: true, input_html: { autocomplete: "email" } %>
<%= f.input :password, required: false, input_html: { autocomplete: "current-password" } %>
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
<%= f.button :submit %>
<% end %>
It allows simple replace it back.