feat: update latest weather art display
- Change latest weather art limit from 6 to 20 - Shuffle the collection and display the last 10 items - Update the section title to reflect the shuffling This commit enhances the visibility of the latest weather art by increasing the limit of displayed items. It randomizes the selection of the latest art pieces for a more dynamic user experience, while the UI title is updated to clarify this feature. This change improves user engagement with the content.
This commit is contained in:
parent
f2951e2741
commit
536b97a7da
@ -1,6 +1,6 @@
|
|||||||
class HomeController < ApplicationController
|
class HomeController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@latest_arts = WeatherArt.includes(:city).order(created_at: :desc).limit(6)
|
@latest_arts = WeatherArt.includes(:city).order(created_at: :desc).limit(20).shuffle.last(10)
|
||||||
@featured_arts = WeatherArt.includes(:city).order(created_at: :desc).limit(5)
|
@featured_arts = WeatherArt.includes(:city).order(created_at: :desc).limit(5)
|
||||||
set_meta_tags(
|
set_meta_tags(
|
||||||
title: "AI-Generated Weather Art",
|
title: "AI-Generated Weather Art",
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<!-- 最新天气艺术 -->
|
<!-- 最新天气艺术 -->
|
||||||
<section class="container mx-auto px-4 py-16 space-y-12">
|
<section class="container mx-auto px-4 py-16 space-y-12">
|
||||||
<h2 class="text-3xl font-display font-bold text-center">Latest Weather Art</h2>
|
<h2 class="text-3xl font-display font-bold text-center">Shuffle Latest Weather Art</h2>
|
||||||
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||||
<% @latest_arts.each do |art| %>
|
<% @latest_arts.each do |art| %>
|
||||||
|
Loading…
Reference in New Issue
Block a user