Link Author Names 0:00All right, let's move on to author filtering. Now, one thing you'll notice is that we display the author's name, but we never updated these views to link to that author, even though, in my routes file, we already have a route endpoint set up for that. Okay, let's update those views. First, we'll go into my index view, into my grid, and looks like it's within the card. Okay, let's see where the author's name is, right there.and looks like it's within the card. Okay, let's see where the author's name is, right there. So why don't we make this a link? Like that. And the link will go to slash authors slash the post's author. And what was the endpoint here? The username. Like so. Okay, and again, we should probably get rid of that.Like so. Okay, and again, we should probably get rid of that. Let's have a look. Here's our post card, yeah. And now I should be able to click on that. And it takes me to the author, but it looks like I screwed up and we have an extra space. We did. One more time. There we go. Oh, and it looks like we forgot to update that post view at the end of the previous episode.There we go. Oh, and it looks like we forgot to update that post view at the end of the previous episode. But it is working. Okay. Before we fix that, let's go to the featured card and do the same thing here. And we'll just grab all of that. There we go. Next, in my routes file, we need to update this view just a little bit longer. Author Route Filtering 1:20Next, in my routes file, we need to update this view just a little bit longer. And if I come back and give this a refresh, now I see only the post written by Eve. Or I can go on back. Let's find one written by Elizabeth. And again, I think we only have one post per author. But the important thing is it's working. So now, why don't we make authors a part of the post filter? And you already know how to do this, so it should be pretty easy. Add Author to Filters 1:41So now, why don't we make authors a part of the post filter? And you already know how to do this, so it should be pretty easy. We can copy this whole thing and just tweak it. If we have author, then that will be their username in this case. So what is the relationship between a post and an author? Well, like so. It belongs to an author. So give me the posts that have an author specifically where the author's username matches up.So give me the posts that have an author specifically where the author's username matches up. Okay, so let's just go back to our post controller, accept the author as well, and we'll give it a shot. Give this a refresh. Let's click on Elizabeth again. And then we'll have to update this. Author equals Vance. And there we go. We get one result. So again, don't forget, you can combine these now. Combine Filter Parameters 2:33And there we go. We get one result. So again, don't forget, you can combine these now. So we can say give me all the blog posts by this author in this category that match this search query. And search equals that. And again, of course, we're going to get that post, but you get the idea. Now, if we were to add, let's see, categories, how about something in this category? And category equals that, and that's going to fail. Update Show Page Links 2:54how about something in this category? And category equals that, and that's going to fail. Or it's not going to fail, but it's not going to return any results because she hasn't written anything in that category yet. But yeah, it's cool how we can stack on this filtering. Okay, so I think we're about done for this episode. The only remaining step on the show page, we want to make sure her name is clickable as well. And then we have to update the URL. So post.show.And then we have to update the URL. So post.show. And where do we have the author? There it is. So real quick, let's just go to postcard and snatch it. And there we go. Does that work? And then we have to update her URL. Now, we will need to update this to, what do we have here? Author, like that. And then post featured card, same thing.Author, like that. And then post featured card, same thing. And then finally, and post show there as well. And I think that'll do it. Okay, so give this a refresh so we can view only her posts. And that looks good. I'm just checking over all of this. And yeah, I think that's looking pretty good. Okay, so now if you want, we can get rid of this route as well. And that leaves us with this. We can get rid of all of that, reformat. Cleanup Routes and Controller 4:09And that leaves us with this. We can get rid of all of that, reformat. And that's what we end up with. A single post controller where we filter the results down. I don't know about you, but I think this is looking pretty clean.