diff --git a/app/views/cities/show.html.erb b/app/views/cities/show.html.erb index 537d899..25ae9c3 100644 --- a/app/views/cities/show.html.erb +++ b/app/views/cities/show.html.erb @@ -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 %> - <% elsif @city.state.name.present? %> + <% elsif @city.state.present? %>
<%= @city&.state&.name %>
diff --git a/app/views/weather_arts/show.html.erb b/app/views/weather_arts/show.html.erb index 6fa8dac..c3975c6 100644 --- a/app/views/weather_arts/show.html.erb +++ b/app/views/weather_arts/show.html.erb @@ -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 %> - <% elsif @weather_art.city.state.name.present? %> + <% elsif @weather_art.city.state.present? %>
<%= @weather_art&.city&.state&.name %>