I need create a link to users/id/microposts where id is the user id. I was wondering how I could do that with link_to?
The HTML code is I am using for the moment is :
<strong><a href="/users/<%= @user.id %>/microposts">Microposts</a></strong> <%= user.microposts.count %>
Which renders the following :
<a href="/users/1/microposts">Microposts</a>
In routes.rb, you should have something like this:
and in view, you can do like this: