I'm using Elixir 1.7.2
+ Phoenix 1.3
and I've a delete link that has a data prompt of "Are you sure?"
before confirming the deletion.
The problem is, when you click the delete
button in the application it asks for multiple consecutive "Are you sure?"
confirmations (sometimes as many as 6) before it actually allows you to delete.
The code for the delete link is:
<%= link to: project_document_path(conn, :delete, project, document),
method: :delete,
data: [confirm: "Are you sure?"] do %>
<img class="absolute k-w2-5 top-0 left-1" src="/images/delete.svg" />
<% end %>
Has anyone else experienced this behaviour in Phoenix with links that have confirmation prompts and knows how to solve it?
Thanks in advance!
This was happening because we were requiring our javascript file in multiple locations, one for each time we were calling a javascript function. We now have one instance of our require in our app.html.eex
file which covers our whole view file tree. This is the code that was replicated:
<script src="<%= static_path(@conn, "/js/app.js") %>"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With