I'm still very much a novice and can't figure out how to get my blog titles to link to the full post. I'm using the friendly id gem and built this basic blog following the Getting started instructions at http://guides.rubyonrails.org/getting_started.html
Below is my current code which converts the title into a link but all titles are continuing to link to the index page for posts.The linkable title should point to something similar to this example:
example.com/posts/my-first-blog-post
<h1>The Blog!</h1>
<div class="container">
<div class="row">
<div class="col-md-1">
<% @posts.each do |post| %>
<h2><%= link_to post.title %></h2>
<P><%= truncate (post.body), :length => 250 %></p>
<% end %>
</div>
</div>
</div>
I would greatly appreciate any help getting these title to link to the link name created using friendly id. If it makes any difference the slug is generated from the title and I did add and save the slug for all previously published blog post when I wasn't using friendly id.
Thank you in advance for the help.