From 98a335100b1b72a8d29ab2ba9546ce2fb89ffcb0 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Sat, 15 Feb 2025 16:32:58 +0800 Subject: [PATCH] refactor: move map partial to shared directory - Renamed `app/views/cities/_map.html.erb` to `app/views/shared/_map.html.erb` - Updated references to the map partial in `cities/show.html.erb` and `weather_arts/show.html.erb` - Adjusted the layout in `cities/show.html.erb` and `weather_arts/show.html.erb` for visual consistency. This refactoring improves code reusability and maintainability by centralizing the map component. It also improves the visual presentation of the application. --- app/views/cities/show.html.erb | 12 +++++++----- app/views/{cities => shared}/_map.html.erb | 2 +- app/views/weather_arts/show.html.erb | 6 +++++- 3 files changed, 13 insertions(+), 7 deletions(-) rename app/views/{cities => shared}/_map.html.erb (95%) diff --git a/app/views/cities/show.html.erb b/app/views/cities/show.html.erb index 02db839..d65a696 100644 --- a/app/views/cities/show.html.erb +++ b/app/views/cities/show.html.erb @@ -10,7 +10,7 @@ <% end %> -
+
<%= link_to cities_path, class: "inline-flex items-center btn btn-ghost gap-2 " do %> @@ -23,7 +23,7 @@
-
+

<%= @city.localized_name %>

@@ -61,7 +61,9 @@ ], as: :stat %>
- <%= render 'cities/map', city: @city %> +
+ <%= render 'shared/map', city: @city %> +
<%= render 'cities/admin_panel' %>
@@ -71,8 +73,8 @@
-
-
+
+

Weather Art History

diff --git a/app/views/cities/_map.html.erb b/app/views/shared/_map.html.erb similarity index 95% rename from app/views/cities/_map.html.erb rename to app/views/shared/_map.html.erb index ebcca99..2bcc1d1 100644 --- a/app/views/cities/_map.html.erb +++ b/app/views/shared/_map.html.erb @@ -1,5 +1,5 @@ -
+
-
+
@@ -73,6 +73,10 @@
+
+ <%= render 'shared/map', city: @weather_art.city %> +
+