-
<%= city.name %>
-
Latitude: <%= city.latitude %>
-
Longitude: <%= city.longitude %>
-
- <%= link_to "View Weather Art", city_path(city), class: "btn btn-primary" %>
+ <% latest_art = city.weather_arts.last %>
+
+ <% if latest_art&.image&.attached? %>
+
+ <% end %>
+
+
+
<%= city.name %>
+
+
Lat: <%= city.latitude %>
+
Long: <%= city.longitude %>
+
+
+ <%= link_to "View Weather Art", city_path(city),
+ class: "btn btn-primary" %>
diff --git a/app/views/cities/show.html.erb b/app/views/cities/show.html.erb
index c8407fd..f106856 100644
--- a/app/views/cities/show.html.erb
+++ b/app/views/cities/show.html.erb
@@ -1,49 +1,91 @@
-
-
-
<%= @city.name %>
- <%= link_to "Back to Cities", cities_path, class: "btn btn-ghost" %>
-
+
+
+
+ <% if @city.latest_weather_art&.image&.attached? %>
+ <%= image_tag @city.latest_weather_art.image,
+ class: "w-full h-full object-cover" %>
+
+ <% end %>
-
-
-
Latitude
-
<%= @city.latitude %>
-
-
-
Longitude
-
<%= @city.longitude %>
-
-
-
-
-
Weather Art History
-
- <% @city.weather_arts.order(weather_date: :desc).each do |art| %>
-
-