today_ai_weather/app/controllers/home_controller.rb
songtianlun 6f2a42b92b refactor: prioritize latest arts over featured
- Comment out featured arts in home controller
- Update index.html.erb to display latest arts instead of featured

This change aims to keep the displayed arts up-to-date and fresh by showing the latest ones, enhancing user experience by providing more current content.
2025-02-16 01:14:25 +08:00

14 lines
690 B
Ruby

class HomeController < ApplicationController
def index
@popular_arts = WeatherArt.includes(:city, :image_attachment).by_popularity(3)
# @random_arts = WeatherArt.includes(:city, :image_attachment).random(3)
@latest_arts = WeatherArt.includes(:city, :image_attachment).latest(6)
# @featured_arts = WeatherArt.includes(:city, :image_attachment).order(created_at: :desc).limit(5)
set_meta_tags(
title: "AI-Generated Weather Art",
description: "Experience weather through artistic AI visualization. Daily updated weather art for cities worldwide.",
keywords: "AI weather art, weather visualization, city weather, artificial intelligence"
)
end
end