I am trying to check whether a record has been updated/edited, and if it has, then it should display that is has been edited.
This is my if statement:
<% if comment.changed? %>
<p id="comment-name"><%= comment.user.name %>(edited)</p>
<% else %>
<p id="comment-name"><%= comment.user.name %></p>
<% end %>
Although it isn't working. When a comment is updated, no (edited)
text is showing. What do I need to put in the if statement to check whether the comment record has been updated?