Link to delete path not recognizing delete method

Hello, do you have any “weird” experiences why suddenly links with method delete isn’t working?

I’m working on this small project and while adding new features to it, suddenly the link with method delete not working anymore.

I just adding fontawesome and css for styling my web pages then suddenly, i can’t log out.

It is throwing error msg like

o route found for GET /logout (AppWeb.Router)

But this is understood because this route is not a GET but DELETE.

Although i’ve been adding new features to this project, i didn’t touch this part of code and it’s been working okay since but not now.

I’ve check my link in my template, that points to session path delete method that points to my delete function in my controller and are correct.

Any idea what might be the reason? :pray:

There is a piece of Javascript that binds an event handler to those links to handle the method part - do you see any errors in the browser console?

2 Likes

Hi!

Please check that you have in assets/app.js this line
import 'phoenix_html'

Also in mix.exs you need to have this line:
{:phoenix_html, "~> 3.0"},

Yes sir, this statements are present.

I can now confirm that my experience last day was really weird. After being burnt-out and decided not to touch it yesterday, i tried to open the project again and suddenly everything works again… :flushed: