Strange behavior when sending delete request in phoenix

I am following the phoenix book but using phoenix 1.6 instead.

At chapter 5, when implemented the logout function, I sent a delete request to clear the session. When I clicked the logout link, a submit button appeared at the bottom left of the page:

Here is the code of the link

      <section class="container">
        <nav role="navigation">
            <%= if @current_user do %>
              <li><%= @current_user.username %></li>
                <%= link("Log out",
                  to: Routes.session_path(@conn, :delete, @current_user),
                  method: "delete"
                ) %>
            <% else %>
              <li><%= link("Register", to: Routes.user_path(@conn, :new)) %></li>
              <li><%= link("Log in", to: Routes.session_path(@conn, :new)) %></li>
            <% end %>
        <a href="" class="phx-logo">
          <img src={Routes.static_url(@conn, "/images/phoenix.png")} alt="Phoenix Framework Logo" />

I made another delete route which only redirect to another page and had the same issue. When I tried to change the method of the test link to something else, the button didn’t appear.

Is it a known issue? how to fix it?

1 Like

Turned out that it is a bug in phoenix_html 3.3.0.

I reported it and Jose already pushed a fix.