Skip to content

Commit

Permalink
Disable Turbo form submission for Devise
Browse files Browse the repository at this point in the history
Devise doesn't yet really support Turbo. As a result, the
suggested (and easiest) approach is just to disable Turbo submission
of Devise forms for now.

Here is the Devise issue: heartcombo/devise#5340
  • Loading branch information
hartsick committed Mar 30, 2022
1 parent 576e91a commit 3530e62
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/views/devise/confirmations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>

<div class="actions py-3">
<%= f.submit "resend confirmation instructions", class: "block btn" %>
<%= f.submit "resend confirmation instructions", class: "block btn", data: { turbo: false } %>
</div>
<% end %>

Expand Down
4 changes: 2 additions & 2 deletions app/views/devise/passwords/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="field">
<%= f.label :password, "new password", class: "block font-semibold text-primary-100" %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em><br />
<em class="text-primary-100">(<%= @minimum_password_length %> characters minimum)</em><br />
<% end %>
<%= f.password_field :password, autofocus: true, autocomplete: "new-password", autocapitalize: "off", spellcheck: "false", class: "border-none w-full md:w-6/12 py-1 px-1 mb-3 bg-primary-100" %>
</div>
Expand All @@ -18,7 +18,7 @@
</div>

<div class="actions py-3">
<%= f.submit "change my password", class: "block btn" %>
<%= f.submit "change my password", class: "block btn", data: { turbo: false } %>
</div>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/passwords/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>

<div class="actions py-3">
<%= f.submit "send me reset password instructions", class: "btn" %>
<%= f.submit "send me reset password instructions", class: "btn", data: { turbo: false } %>
</div>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<% end %>

<div class="actions py-3">
<%= f.submit "log in", class: "block btn" %>
<%= f.submit "log in", class: "block btn", data: { turbo: false } %>
</div>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/unlocks/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>

<div class="actions py-3">
<%= f.submit "resend unlock instructions", class: "block btn" %>
<%= f.submit "resend unlock instructions", class: "block btn", data: { turbo: false } %>
</div>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<%= link_to '*s', my_starred_path, class: 'px-1 link' %>
<%= link_to '@s', my_mentions_path, class: 'px-1 link' %>
<%= link_to 'my profile', my_profile_path, class: 'px-1 link' %>
<%= link_to "sign out", destroy_user_session_path, method: :delete, class: "px-1 link" %>
<%= link_to "sign out", destroy_user_session_path, method: :delete, class: "px-1 link", data: { turbo_method: "delete" } %>
<% else %>
<%= link_to "sign in", new_user_session_path, class: 'link' %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/invitations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
<% end %>

<div class="actions py-3">
<%= f.submit "create account", class: "btn" %>
<%= f.submit "create account", class: "btn", data: { turbo: false } %>
</div>
<% end %>
2 changes: 1 addition & 1 deletion app/views/users/invitations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
</div>

<div class="actions py-3">
<%= f.submit "invite", class: "btn" %>
<%= f.submit "invite", class: "btn", data: { turbo: false } %>
</div>
<% end %>

0 comments on commit 3530e62

Please sign in to comment.