I am getting the following error an UPDATE to an existing post on the Blog app (Rails):
I changed author_posts_path
to author_post_path
when I was getting an error
No route matches [PATCH] "/posts/my-second-post"
Now, I'm getting a new error as follows:
ActionController::UrlGenerationError in Blog::Posts#index
Showing C:/Users/Royal and Carla/Desktop/testBlog3c/app/views/layouts/_navbar.html.erb where line #18 raised:
No route matches {:action=>"show", :controller=>"author/post"}, missing required keys: [:id]
views/layouts/_navbar.html.erb
16 </li>
17 <li class="nav-item">
18 <%= link_to 'My posts', author_post_path, class: "nav-link #
{yield(:author)}" %>
19 </li>
20 </ul>
21 </div>
ontrollers/author/posts_controller.rb
private
def set_post
@post = Post.friendly.find(params[:id])
end
def post_params
params.require(:post).permit(:title, :body, :description, :banner_image_url)
end
routes.rb
file – fool-dev