diff --git a/app/models/city.rb b/app/models/city.rb index 38461e1..95f8f4d 100644 --- a/app/models/city.rb +++ b/app/models/city.rb @@ -84,7 +84,7 @@ class City < ApplicationRecord end def localized_name - I18n.t("cities.#{name.parameterize.underscore}") + I18n.t("cities.#{name.parameterize.underscore}", default: name) end def full_name diff --git a/app/views/cities/show.html.erb b/app/views/cities/show.html.erb index 55f6353..c709d87 100644 --- a/app/views/cities/show.html.erb +++ b/app/views/cities/show.html.erb @@ -35,7 +35,7 @@ <%= @city.country.name %>, <%= @city.region %>
- <%= Time.current.in_time_zone(@city.timezone).strftime("%Y-%m-%d %H:%M") %> + <%= @city.timezone.present? ? Time.current.in_time_zone(@city.timezone).strftime("%Y-%m-%d %H:%M") : "Timezone undefined" %>