today_ai_weather/db/migrate/20250226011649_add_slug_to_states.rb
songtianlun f51dc8370b feat: add state filtering to cities index
- Implement state filtering in the CitiesController
- Add new scope `by_state` in the City model
- Update cities index view to include state dropdown
- Add slug column to states for friendly URLs
- Update English locale to include 'All States'

This commit enhances the cities index page by allowing users to
filter cities based on the selected state. It introduces a new
scope in the City model for state filtering and updates the
view to present a dropdown for state selection. Additionally,
it adds a slug column to the states table to support friendly
URLs, improving the overall user experience.
2025-02-26 09:48:39 +08:00

7 lines
158 B
Ruby

class AddSlugToStates < ActiveRecord::Migration[8.0]
def change
add_column :states, :slug, :string
add_index :states, :slug, unique: true
end
end