2025-01-19 12:21:00 +08:00
|
|
|
class WeatherArtsController < ApplicationController
|
|
|
|
def show
|
2025-01-19 22:08:05 +08:00
|
|
|
@city = City.friendly.find(params[:city_id])
|
2025-01-22 14:04:58 +08:00
|
|
|
@weather_art = @city.weather_arts.friendly.find(params[:slug])
|
2025-01-27 00:43:18 +08:00
|
|
|
|
|
|
|
ahoy.track "View Weather Art", {
|
|
|
|
weather_art_id: @weather_art.id,
|
|
|
|
city_id: @weather_art.city_id,
|
2025-01-27 00:43:36 +08:00
|
|
|
event_type: "weather_art_view"
|
2025-01-27 00:43:18 +08:00
|
|
|
}
|
|
|
|
ahoy.track "View City", {
|
|
|
|
city_id: @city.id,
|
|
|
|
name: @city.name,
|
2025-01-27 00:43:36 +08:00
|
|
|
event_type: "city_view"
|
2025-01-27 00:43:18 +08:00
|
|
|
}
|
|
|
|
|
2025-01-23 19:02:52 +08:00
|
|
|
set_meta_tags(
|
|
|
|
title: "#{@city.name} Weather Art - #{@weather_art.weather_date.strftime('%B %d, %Y')}",
|
|
|
|
description: "#{@city.name}'s weather visualized through AI art. #{@weather_art.description} at #{@weather_art.temperature}°C.",
|
|
|
|
keywords: "#{@city.name}, weather art, #{@weather_art.description}, AI visualization",
|
|
|
|
og: {
|
|
|
|
image: @weather_art.image.attached? ? url_for(@weather_art.image) : nil
|
|
|
|
}
|
|
|
|
)
|
2025-01-19 12:21:00 +08:00
|
|
|
end
|
|
|
|
end
|