In your link_to
helper you have "posts"
as the URL. This appends the string posts
to the end of the current url, which is the reason why you're seeing example.com/posts/posts
.
To have the link properly point to /posts
, modify your link_to
call as follows:
<li><%= link_to "Blog", "/posts" %></li>
or use route helper:
<li><%= link_to "Blog", posts_path %></li>