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": enter image description here

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

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -