diff --git a/app/views/items/show.html.erb b/app/views/items/show.html.erb index bf525af..c833737 100644 --- a/app/views/items/show.html.erb +++ b/app/views/items/show.html.erb @@ -1,55 +1,47 @@

Item history

Current values

-
-
Date found
-
<%= @item.date_found.strftime('%m/%d/%Y') %>
-
-
-
Time found
-
<%= @item.datetime_found&.strftime('%l:%M %P') || 'None' %>
-
-
-
Found by
-
<%= @item.found_by || 'No one' %>
-
+
+
Date found
+
<%= @item.date_found.strftime('%m/%d/%Y') %>
-
-
Item location
-
<%= @item.location %>
-
+
Time found
+
<%= @item.datetime_found&.strftime('%l:%M %P') || 'None' %>
-
-
Type of item
-
<%= @item.item_type %>
-
+
Found by
+
<%= @item.found_by || 'No one' %>
-
-
Item description
-
<%= @item.description %>
-
+
Item location
+
<%= @item.location %>
-
-
Item image
+
Type of item
+
<%= @item.item_type %>
+ +
Item description
+
<%= @item.description %>
+ +
Item image
+
<% if @item.image.attached? %> image of item <% else %> -
No image
+ No image <% end %> -
-
-
Last updated by
-
<%= @item.updated_by || 'None' %>
-
-
-
Last updated
+ + +
Last updated by
+
<%= @item.updated_by || 'None' %>
+ +
Last updated
+
<% if @item.updated_at != @item.created_at %> -
<%= @item.updated_at.in_time_zone.strftime('%m/%d/%Y %l:%M %P') %>
+ <%= @item.updated_at.in_time_zone.strftime('%m/%d/%Y %l:%M %P') %> <% else %> -
None
+ None <% end %> -
+ +

Change history

diff --git a/spec/views/items/show.html.erb_spec.rb b/spec/views/items/show.html.erb_spec.rb index 8017db3..0526608 100644 --- a/spec/views/items/show.html.erb_spec.rb +++ b/spec/views/items/show.html.erb_spec.rb @@ -70,7 +70,7 @@ it 'renders that the item has not been updated' do render - expect(rendered).to have_content "Last updated\n None" + expect(rendered).to have_content(/Last updated\s+None/i) end end end