Class: WorldDbAdmin::CitiesController
- Inherits:
-
WorldDbAdminController
- Object
- ActionController::Base
- WorldDbAdminController
- WorldDbAdmin::CitiesController
- Defined in:
- app/controllers/world_db_admin/cities_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
GET /cities.
-
#shortcut ⇒ Object
GET /:key.
Instance Method Details
#index ⇒ Object
GET /cities
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/world_db_admin/cities_controller.rb', line 8 def index order = params[:order] @cities = case order when 'pop' then City.by_pop.all when 'popm' then City.order( 'popm desc' ).all when 'title' then City.by_title.all else City.by_key.all end end |
#shortcut ⇒ Object
GET /:key
21 22 23 24 |
# File 'app/controllers/world_db_admin/cities_controller.rb', line 21 def shortcut ## for now just redirect to cities page w/ anchor includes e.g cities/#newyork redirect_to cities_path( :anchor => params[:key] ) end |