- Refactor keywords in cities_controller.rb - Refactor keywords in weather_arts_controller.rb - Refactor keywords in application.html.erb This change improves the SEO of the application by updating keywords to include 'ai' and 'ai web', which are more relevant and likely to enhance search visibility. The previous keywords were less optimized for current trends in AI-related searches.
27 lines
966 B
Ruby
27 lines
966 B
Ruby
class WeatherArtsController < ApplicationController
|
|
def show
|
|
@city = City.friendly.find(params[:city_id])
|
|
@weather_art = @city.weather_arts.friendly.find(params[:slug])
|
|
|
|
ahoy.track "View Weather Art", {
|
|
weather_art_id: @weather_art.id,
|
|
city_id: @weather_art.city_id,
|
|
event_type: "weather_art_view"
|
|
}
|
|
ahoy.track "View City", {
|
|
city_id: @city.id,
|
|
name: @city.name,
|
|
event_type: "city_view"
|
|
}
|
|
|
|
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}, #{@city.country.name}, ai, ai web, ai art, ai weather, weather art, AI visualization, #{@weather_art.description}",
|
|
og: {
|
|
image: @weather_art.image.attached? ? url_for(@weather_art.image) : nil
|
|
}
|
|
)
|
|
end
|
|
end
|