1
00:00:01,440 --> 00:00:07,170
In this video, we are going to redirect the user after creating a comment.

2
00:00:07,170 --> 00:00:14,280
But for the redirect, I want the user to be on the same page so that they can refresh and give us the

3
00:00:14,280 --> 00:00:15,680
updated comment.

4
00:00:15,690 --> 00:00:21,940
So let's get back to the controller of the comment and here we go.

5
00:00:22,140 --> 00:00:29,490
And this is a response we got inside the browser, so I'm going to remove this one, but instead I'm

6
00:00:29,490 --> 00:00:32,880
going to redirect to a single page.

7
00:00:32,880 --> 00:00:34,320
So let's have a look.

8
00:00:34,320 --> 00:00:36,420
I'm going to be as redirect.

9
00:00:37,620 --> 00:00:41,730
And you're going to be as red, dirt, red direct.

10
00:00:43,550 --> 00:00:49,790
So for this, we are going to target the routes that fetch a single post.

11
00:00:49,880 --> 00:00:57,710
So let's get back to the post controller and let's have a look if indeed this post is rendering the

12
00:00:57,710 --> 00:01:01,160
post details and indeed it is rendering that.

13
00:01:01,190 --> 00:01:03,080
So we are going to target this.

14
00:01:03,080 --> 00:01:04,670
So let's look at the path.

15
00:01:04,670 --> 00:01:13,100
Well, let's get back to route post and then the post thought, geez, and this is the first single

16
00:01:13,100 --> 00:01:13,550
post.

17
00:01:13,550 --> 00:01:17,420
What is this going to be for last ID?

18
00:01:17,420 --> 00:01:24,110
So let's get back here and then for the redirect, I'm going to use back it because I want to provide

19
00:01:24,110 --> 00:01:25,970
the ID of the post.

20
00:01:25,970 --> 00:01:33,410
So we're going to be API version one post and then the ID of the post.

21
00:01:33,410 --> 00:01:36,170
And lucky for us we have it as that.

22
00:01:36,170 --> 00:01:41,150
So we're going to be dollar sign and then post.

23
00:01:41,930 --> 00:01:42,740
Dot.

24
00:01:44,520 --> 00:01:45,990
And that's called ID.

25
00:01:46,470 --> 00:01:48,870
So let's see if it's going to work.

26
00:01:49,870 --> 00:01:50,980
Refresh it.

27
00:01:51,700 --> 00:01:54,850
And let me copy this text for comment.

28
00:01:58,930 --> 00:02:05,110
And indeed it has been directed me to have this comment in the next video.

29
00:02:05,110 --> 00:02:08,229
Let's improve the course of the comment.

