Check my website: www.alexandrecalaca.com.br
Now, it's time to rock. Go to rails console.
rails console
Create one blog and see the slug created
Blog.create!(title: "My amazing post", body: "My amazing body")
The result is going to be something like this:
#<Blog id: 22, title: "My amazing post", body: "My amazing body", created_at: "2018-05-29 01:43:12", updated_at: "2018-05-29 01:43:12", slug: "my-amazing-post">
Now, it's time to change the look up system in your controller by adding "friendy". Since, I already have lookup method in Rails, I'll be using there. Check it out:
def set_blog
@blog = Blog.friendly.find(params[:id])
end