views:

34

answers:

2

I have

<%=link_to distance_of_time_in_words_to_now(post.created_at), post %> ago

However I want to make 'ago' show up in link as well. Now its something like '20 minutes ago,' which kind of looks ugly. I want it to look like 20 minutes ago.'

I tried using #{} with no success and Google search turns out very little, especially since I don't even know what I'm looking for.

Any suggestions?

+3  A: 

This must work:

<%= link_to "#{distance_of_time_in_words_to_now(post.created_at)} ago", post %>

Don't know why it didn't work for you. Any code samples?

Eimantas
Because I'm an idiot, I forgot the quotes. Thanks!
Senthil
+1  A: 

Try:

<%= link_to "#{distance_of_time_in_words_to_now(post.created_at)} ago", post %>
John Topley