The method signature (the way you use it) is:
link_to text_to_display, path
If you follow Rails standards, you should do:
link_to post.title, post_path(post.slug)
Actually .slug
is not required because FriendlyId overrides the to_param
method in your model.
So you can do:
link_to post.title, post_path(post)
Or even
link_to post.title, post
Up to you...