Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Whitney-Rose Levis
264 PointsTreebook not displaying "time ago"
I can't get treebook to display the timestamp in any form. What am I doing wrong?
<div class="page-header"> <h1>All of the Statuses</h1> </div>
<% @statuses.each do |status| %> <div class="status"> <strong><%= status.name %></strong> <p><%= status.content %></p> <div class"meta"> <% link_to time_ago_in_words(status.created_at) + " ago", status %> <span class="admin"> | <%= link_to "Edit", edit_status_path(status) %> | <%= link_to "Delete", status, method: :delete, data: { confirm: "Are you sure you want to delete this?"} %> </span> </div> </div> <% end %>

Whitney-Rose Levis
264 PointsIt does have the link_to. The way the copy-paste worked it put everything in a big heaping paragraph but it is there.
2 Answers

Jake Rorrer
17,788 PointsIt looks like your link_to is currently this for displaying time ago:
<% link_to time_ago_in_words(status.created_at) + " ago", status %>
The reason it's not showing up is because you left out an = sign. Here is what it should look like:
<%= link_to time_ago_in_words(status.created_at) + " ago", status %>
That should hopefully do the trick!

Whitney-Rose Levis
264 PointsThanks both of you. I had not read the previous response carefully enough. Coming at it fresh it is all quite clear. Thanks a bunch.

Jake Rorrer
17,788 PointsYou're welcome. Glad to help! :)
Bertan Ulusoy
18,047 Pointsyou are welcome...
Bertan Ulusoy
18,047 PointsBertan Ulusoy
18,047 PointsHi,
You forgot equal sign before link_to.
it should look like this -> <%= link_to time_ago_in_words(status.created_at)...