Skip to content

Commit

Permalink
Recommend button_to for non-GET requests
Browse files Browse the repository at this point in the history
This will make sure the button works even before Turbo JS has been
loaded.
  • Loading branch information
janko committed Apr 8, 2024
1 parent 57e2a84 commit ae872bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ navigation header:

```erb
<% if rodauth.logged_in? %>
<%= link_to "Sign out", rodauth.logout_path, data: { turbo_method: :post } %>
<%= button_to "Sign out", rodauth.logout_path, method: :post %>
<% else %>
<%= link_to "Sign in", rodauth.login_path %>
<%= link_to "Sign up", rodauth.create_account_path %>
Expand Down

0 comments on commit ae872bf

Please sign in to comment.