This is the easy way:
<%= form_with url: destroy_user_session_path, method: :delete do %> <%= submit_tag 'Log Out' %> <% end %>