Phoenix Link with other method than GET not working

I upgraded my umbrella with a phoenix app to Erlang 21+ and Elixir 1.7+.
After that, my phoenix links with other method than get are not working (POST & DELETE).
Do you experience that?

eex

<%= link to: template_account_path(@conn, :like, @locale, i), method: :post, class: "dropdown-item" do %>
...<% end %>

html

<a class="dropdown-item" data-csrf="BThAVCEeXhYbQjwHdAg6D3pxFVwMAAAA1A5aq17dj6VWEObDUGaiOA==" data-method="post" data-to="/pt/messages/campaign/20/like" href="#" rel="nofollow">...</a>

Have you force-rebuilt all your deps, even the JavaScript ones?

Yes, with npm update & brunch build.
All other functionalities are working.
Is there a different build process for Umbrella with Phoenix?

Well, I did not just mean to run the commands, I especially meant to remove all the stuff before re-installing/building them.

Perhaps you might even need to unlock some deps.

1 Like

Thanks. It worked after a new forced rebuilt.

2 Likes

Could you expain more how did you solved it? I’m experimenting the same problem but I’m not being able to solve it just updating dependencies.

What’s the exact error you are getting?

It generates the anchor with data-method=“post”

<a class="none" data-csrf="UGYnEmVsBwQfIWMyDwUJeEs+OWwXNgAA11td/UWuqvHULbJO9Gi+tA==" data-method="post" data-to="/projects/3/features/5/votes?value=-1" href="/projects/3/features/5/votes?value=-1" rel="nofollow">

But it arrives as GET request

A link will always arrive as a get request, that’s how the HTML spec works unless you have some javascript library doing otherwise?

I don’t use phoenix’s library except for sockets but if it has any of such feature then you need to make sure it is loaded properly. So what is a URL to the page that shows the issue?

1 Like

I THINK phoenix_html handles this for you. Do you have import "phoenix_html" in your app.js?

2 Likes

Thank you very much! At the end, I think in some clean I deleted

import "phoenix_html"

from app.js so now I’m done!

2 Likes

Thank you very much! At the end, I think in some clean I deleted

import "phoenix_html"

from app.js so now I’m done!