I’ve simplified the code for the post’s sake. Either way, after submitting my form I get back on the profile page, but it gives me a 404 instead of displaying back the profile.
I don’t quite understand where the error occurs? On the newly generated page or on the profile page? Have you checked if the page get’s created in the filesystem? It does not matter how the page is created.
Sorry, I’m so frustrated after countless tries I can’t even formulate this right.
So on my route generated profile for a user (localhost/profile/user), I list all the posts by that user via a snippet. On the same page, above the listed posts, I have a form with a textarea and a submit button.
When you type something in the textarea and submit it, a child page of posts/user should be created. Unfortunately, the page doesn’t get created (not even in the file system), and while it still keeps me on the same link for the user profile page, it gives me a 404.
I thought it might be a problem because the profile page doesn’t actually exist since it’s generated via calling a template through a route.
UPDATE: It seems like no matter what’s in the controller for the form bit, it still returns a 404 on submit.
For example when submitting the form, even with this, I still get a 404: