I'm using friendly_id gem in my app. How can I get object's friendly id? When I write @post.id
I get 1
but how can I get first_post
instead?
Asked
Active
Viewed 205 times
0

Pavel
- 1,934
- 3
- 30
- 49
-
friendly_id used to change your app urls to http://example.com/states/washington instead of: http://example.com/states/4323454 ,what do you mean of first_post ? – Remon Amin Feb 02 '14 at 21:10
2 Answers
3
There should a method called friendly_id
@post.id # => 1
@post.friendly_id # => first_post
Hope this helps

strivedi183
- 4,749
- 2
- 31
- 38