changes how comment.created_at is shown

time_ago_in_words is not cache friendly
This commit is contained in:
Juanjo Bazán
2015-09-09 14:57:27 +02:00
parent e24e9e7be8
commit 811c329199
4 changed files with 6 additions and 2 deletions

View File

@@ -59,7 +59,7 @@
<% end %>
&nbsp;&bullet;&nbsp;<%= time_ago_in_words(comment.created_at) %>
&nbsp;&bullet;&nbsp;<%= l comment.created_at.to_datetime, format: :datetime %>
</div>
<% if comment.as_administrator? %>

View File

@@ -20,3 +20,6 @@
# available at http://guides.rubyonrails.org/i18n.html.
en:
time:
formats:
datetime: "%Y-%m-%d %H:%M:%S"

View File

@@ -196,4 +196,5 @@ es:
default: "%A, %d de %B de %Y %H:%M:%S %z"
long: "%d de %B de %Y %H:%M"
short: "%d de %b %H:%M"
datetime: "%d/%m/%Y %H:%M:%S"
pm: pm

View File

@@ -14,7 +14,7 @@ feature 'Comments' do
comment = Comment.last
within first('.comment') do
expect(page).to have_content comment.user.name
expect(page).to have_content time_ago_in_words(comment.created_at)
expect(page).to have_content I18n.l(comment.created_at, format: :datetime)
expect(page).to have_content comment.body
end
end