diff --git a/app/views/cities/show.html.erb b/app/views/cities/show.html.erb index 1c4f40e..537d899 100644 --- a/app/views/cities/show.html.erb +++ b/app/views/cities/show.html.erb @@ -35,7 +35,7 @@ <%= link_to cities_path(country: @city.country, region: @city.country.region), class: "badge badge-lg badge-primary hover:badge-outline transition-all duration-200" do %> <%= "#{@city.country.emoji + " " || ""}#{@city.country.localized_name}" %> <% end %> - <% else %> + <% elsif @city.country.present? %>
<%= "#{@city&.country&.emoji + " " || ""}#{@city&.country&.localized_name}" %>
@@ -45,7 +45,7 @@ <%= link_to cities_path(country: @city.country, state: @city.state, region: @city.country.region), class: "badge badge-lg badge-secondary hover:badge-outline transition-all duration-200" do %> <%= @city.state.name %> <% end %> - <% else %> + <% elsif @city.state.name.present? %>
<%= @city&.state&.name %>
diff --git a/app/views/weather_arts/show.html.erb b/app/views/weather_arts/show.html.erb index 8644bd7..6fa8dac 100644 --- a/app/views/weather_arts/show.html.erb +++ b/app/views/weather_arts/show.html.erb @@ -27,7 +27,7 @@ <%= link_to cities_path(country: @weather_art.city.country, region: @weather_art.city.country.region), class: "badge badge-lg badge-primary hover:badge-outline transition-all duration-200" do %> <%= "#{@weather_art.city.country.emoji + " " || ""}#{@weather_art.city.country.localized_name}" %> <% end %> - <% else %> + <% elsif @weather_art.city.country.present? %>
<%= "#{@weather_art&.city&.country&.emoji + " " || ""}#{@city&.country&.localized_name}" %>
@@ -37,7 +37,7 @@ <%= link_to cities_path(country: @weather_art.city.country, state: @weather_art.city.state, region: @weather_art.city.country.region), class: "badge badge-lg badge-secondary hover:badge-outline transition-all duration-200" do %> <%= @weather_art.city.state.name %> <% end %> - <% else %> + <% elsif @weather_art.city.state.name.present? %>
<%= @weather_art&.city&.state&.name %>