In this video, we are going to redirect the user after creating a comment.
But for the redirect, I want the user to be on the same page so that they can refresh and give us the
updated comment.
So let's get back to the controller of the comment and here we go.
And this is a response we got inside the browser, so I'm going to remove this one, but instead I'm
going to redirect to a single page.
So let's have a look.
I'm going to be as redirect.
And you're going to be as red, dirt, red direct.
So for this, we are going to target the routes that fetch a single post.
So let's get back to the post controller and let's have a look if indeed this post is rendering the
post details and indeed it is rendering that.
So we are going to target this.
So let's look at the path.
Well, let's get back to route post and then the post thought, geez, and this is the first single
post.
What is this going to be for last ID?
So let's get back here and then for the redirect, I'm going to use back it because I want to provide
the ID of the post.
So we're going to be API version one post and then the ID of the post.
And lucky for us we have it as that.
So we're going to be dollar sign and then post.
Dot.
And that's called ID.
So let's see if it's going to work.
Refresh it.
And let me copy this text for comment.
And indeed it has been directed me to have this comment in the next video.
Let's improve the course of the comment.