<% featured_art = WeatherArt.includes(:city).joins(:image_attachment).order(created_at: :desc).first %>
<% if featured_art&.image&.attached? %>
<%= image_tag featured_art.image, class: "w-full h-full object-cover object-center" %>
<% end %>

Explore Cities

Discover AI-generated weather art from cities around the world

<% if featured_art %>
Latest from <%= featured_art.city.name %>, <%= featured_art.city.country.name %> <%= featured_art.weather_date.strftime("%B %d, %Y") %>
<% end %>
<%= link_to cities_path, class: "btn btn-sm #{'btn-primary' unless @current_region} btn-outline" do %> All Regions <% end %> <% @regions.each do |region| %> <%= link_to region.name, cities_path(region: region.slug), class: "btn btn-sm #{'btn-primary' if @current_region == region} btn-outline" %> <% end %>
<% if @current_region %>
<%= link_to cities_path(region: @current_region.slug), class: "btn btn-sm btn-ghost #{'btn-active' unless @current_country}" do %> All in <%= @current_region.name %> <% end %> <% @current_region.countries.order(:name).each do |country| %> <%= link_to country.name, cities_path(region: @current_region.slug, country: country.slug), class: "btn btn-sm btn-ghost #{'btn-active' if @current_country == country}" %> <% end %>
<% end %> <% if @current_region || @current_country %>
<% end %>
Showing <%= @cities.count %> <%= 'city'.pluralize(@cities.count) %> <% if @current_country %> in <%= @current_country.name %> <% elsif @current_region %> in <%= @current_region.name %> <% end %>
<%= render partial: 'city', collection: @cities %>