refactor: update city ordering
Order cities by name instead of filtering active cities. This change simplifies the CitiesController and improves code readability. - Update City.includes method in CitiesController - Remove active filter in City.includes method
This commit is contained in:
parent
bf10e41c1e
commit
5f30e08a6e
@ -1,7 +1,7 @@
|
|||||||
class CitiesController < ApplicationController
|
class CitiesController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@regions = Region.includes(:countries).order(:name)
|
@regions = Region.includes(:countries).order(:name)
|
||||||
@cities = City.includes(:country, country: :region).active.order(:name)
|
@cities = City.includes(:country, country: :region).order(:name)
|
||||||
|
|
||||||
if params[:region]
|
if params[:region]
|
||||||
@current_region = Region.friendly.find(params[:region])
|
@current_region = Region.friendly.find(params[:region])
|
||||||
|
Loading…
Reference in New Issue
Block a user