Class: WorldDbAdmin::RegionsController

Inherits:
WorldDbAdminController show all
Includes:
RoutesHelper
Defined in:
app/controllers/world_db_admin/regions_controller.rb

Instance Method Summary collapse

Methods included from RoutesHelper

#csv_cities_path, #csv_countries_by_tag_path, #csv_countries_path, #short_city_path, #short_country_path, #short_region_path, #short_tag_path, #table_cities_path, #table_countries_by_tag_path, #table_countries_path

Instance Method Details

#indexObject

GET /regions



8
9
10
# File 'app/controllers/world_db_admin/regions_controller.rb', line 8

def index
  @countries = Country.all
end

#shortcutObject

GET /:country_key/:key e.g. /us/ny or /de/by



15
16
17
18
19
# File 'app/controllers/world_db_admin/regions_controller.rb', line 15

def shortcut
  ## for now just redirect to country page w/ anchor includes e.g country/#ny
  country = Country.find_by_key( params[:country_key] )
  redirect_to short_country_path( country, anchor: params[:key] )
end