Closed siobhanjacobson closed 3 years ago
I am looking into this, however, initially, I can't reproduce it. Can you confirm this is still an issue?
I tested this locally with a fresh database reset (rails db:reset), and I got the same error.
sorry...i needed to sync my fork with the main repo...so now i get the error...will work on fix now.
OK...this one led me down some Devise rabbit holes.....
The issue is with the routes. There is no UserController because we use devise to handle the users and sessions. So, the route where we nest food_resources under users creates a bunch of users routes that we don't have a controller for.
But another issue is I can't seem to send "delete" requests to the server. This is true even if you are logged in and try to delete a food_resource. I'm not sure why I am unable to send delete requests, since the links have "method: :delete" in them and Rails seems to render them correctly....
However, if instead of a link_to I use a button_to...the delete request seems to work.....
So, I just thought I'd toss this in here and see if this is something anyone has come across or seen before or has any ideas about. Also wondering if this has something to do with javascript not being configured correctly on the rails server?
I sent a pull request to fix this.....so it's under review at the moment!
Just pinging this one...I think my pull request is still there...hopefully it is ok...was going to work on the form error messaging issue, but didn't want to dive into that with this routing issue still unresolved.
Hey @bthooper I left a comment on your PR over here: https://github.com/codeforUV/food_resources/pull/76#issuecomment-828835513
Looks like the comments on that linked issue mention some workarounds that I think would be worth trying out.
Closed by #76