ruby on rails 4 - time_ago_in_words is cut short -
i face minor problem in chapter 10 of rails tutorial. spec tests pass list of user microposts bit different shown in tutorial - namely, time stamp displayed without "ago" word - "posted 4 days ago" becomes "posted 4 days":
i think followed instructions correctly. here code micropost partial:
<li> <span class="content"><%= micropost.content %></span> <span class="timestamp"> posted <%= time_ago_in_words(micropost.created_at) %> </span> </li>
and here stylesheet:
/* microposts */ .microposts { list-style: none; margin: 10px 0 0 0; li { padding: 10px 0; border-top: 1px solid #e8e8e8; } } .content { display: block; } .timestamp { color: $graylight; } .gravatar { float: left; margin-right: 10px; } aside { textarea { height: 100px; margin-bottom: 5px; } }
what doing wrong?
time_ago_in_words
not add ago
word.you should adding maually.
this should work.
<li> <span class="content"><%= micropost.content %></span> <span class="timestamp"> posted <%= time_ago_in_words(micropost.created_at) %> ago. #here </span> </li>
Comments
Post a Comment