The code refactoring is done by commenting out the random art functionality from the index page and removing the corresponding code from the home_controller. This eliminates the need for a random art display, simplifying the application's behavior. This also fixes a bug where it was showing random arts and makes it so the application runs more efficiently since it's not calling the unnecessary code anymore.
14 lines
688 B
Ruby
14 lines
688 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
|