Skip to content

Instantly share code, notes, and snippets.

@brandoncc
Last active January 3, 2016 07:49
Show Gist options
  • Save brandoncc/8431804 to your computer and use it in GitHub Desktop.
Save brandoncc/8431804 to your computer and use it in GitHub Desktop.

Yours

<h5>Comments:</h5>
<% @post.comments.each do |comment| %>
  <div class='well span8'>
    <p>
      <em><%= comment.body %></em>
    </p>
    <p>
      <span class='quiet'>posted by</span> <%= link_to comment.user.username, '' %> <small> at <%= display_datetime(comment.created_at) %> </small>
    </p>
  </div>
<% end %>

Wrapped

<h5>Comments:</h5>
<% @post.comments.each do |comment| %>
  <% unless comment.new_record? %>
    <div class='well span8'>
      <p>
        <em><%= comment.body %></em>
      </p>
      <p>
        <span class='quiet'>posted by</span> <%= link_to comment.user.username, '' %> <small> at <%= display_datetime(comment.created_at) %> </small>
      </p>
    </div>
  <% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment