I ran into a very strange problem that is hard for me to handle. In my opinion, I have a link with data-remote="true"and data-method="delete". When I click the link, I can see a request DELETEto my rails server. The returned JS code modifies the properties of this link, including hrefand data-method.
When I click this link again, my server receives a request for a new one href, but with the old one data-method, although I changed it from DELETEto POST(it still sends DELETE).
However, if I refresh the page, the HTML is the same as the βnewβ HTML (modified with my returned JS), but it actually sends the correct request type. That's why the problem puzzles me.
source
share