2017-03-20 10:57:50 -05:00
|
|
|
<div>
|
2017-02-13 18:08:51 -06:00
|
|
|
<%= comment.message %>
|
|
|
|
|
|
|
|
<% if policy(comment).update? %>
|
2017-03-20 10:57:50 -05:00
|
|
|
<label class="" for="comment-<%= comment.id %>">edit</label>
|
2017-02-13 18:08:51 -06:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if comment.edits? %>
|
2017-03-20 10:57:50 -05:00
|
|
|
<div>Updated <%= time_ago_in_words(comment.updated_at) %> ago</div>
|
2017-02-24 16:05:10 -06:00
|
|
|
<% else %>
|
2017-03-20 10:57:50 -05:00
|
|
|
<div><%= time_ago_in_words(comment.created_at) %> ago</div>
|
2017-02-13 18:08:51 -06:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
2017-03-20 10:57:50 -05:00
|
|
|
<div><%= comment.user.name %></div>
|
2017-02-13 18:08:51 -06:00
|
|
|
|
|
|
|
<% if policy(comment).update? %>
|
|
|
|
<input type="checkbox" id="comment-<%= comment.id %>">
|
2017-03-20 10:57:50 -05:00
|
|
|
<%= render partial: 'comment_form', locals: {comment: comment, test_hash: comment.test_hash } %>
|
2017-02-13 18:08:51 -06:00
|
|
|
<% end %>
|