From 11d7adba9929e7ac267a0aa1ff7c86fbf3e752cd Mon Sep 17 00:00:00 2001 From: songtianlun Date: Tue, 8 Apr 2025 11:14:00 +0800 Subject: [PATCH] chore: comment out unused popular arts section - Comment out the popular weather art rendering and related titles in the home index view. - Keep the latest weather art section active for display. This change removes sections of code related to popular and random weather art, which are not currently in use, while preserving a clean interface for the latest weather art. --- app/controllers/home_controller.rb | 2 +- app/views/home/index.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index c91a32a..89203e0 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,6 +1,6 @@ class HomeController < ApplicationController def index - @popular_arts = WeatherArt.includes(:image_attachment, city: :country).by_popularity(3) + # @popular_arts = WeatherArt.includes(:image_attachment, city: :country).by_popularity(3) @latest_arts = WeatherArt.includes(:image_attachment, city: :country).latest(6) # @random_arts = WeatherArt.includes(:city, :image_attachment).random(3) # @featured_arts = WeatherArt.includes(:city, :image_attachment).order(created_at: :desc).limit(5) diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index d5dc8a9..dc71487 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -30,8 +30,8 @@

<%= t("title.latest_weather_art") %>

<%= render 'home/arts', arts: @latest_arts %> -

<%= t("title.popular_weather_art") %>

- <%= render 'home/arts', arts: @popular_arts %> + + <%#= render 'home/arts', arts: @popular_arts %> <%#= render 'home/arts', arts: @random_arts %>