Module: WorldDbAdmin::RoutesHelper

Included in:
RegionsController
Defined in:
app/helpers/world_db_admin/routes_helper.rb

Instance Method Summary collapse

Instance Method Details

#csv_cities_pathObject



20
21
22
23
# File 'app/helpers/world_db_admin/routes_helper.rb', line 20

def csv_cities_path
  # dl_cities_path( format: 'csv' )
  '/api/v1/cities.csv'
end

#csv_countries_by_tag_path(tag) ⇒ Object



30
31
32
33
34
# File 'app/helpers/world_db_admin/routes_helper.rb', line 30

def csv_countries_by_tag_path( tag )
  ## NB: tag needs slug NOT key (key may contain spaces)
  ## dl_countries_by_tag_worker_path( tag.slug, format: 'csv')
  "/api/v1/tag/#{tag.slug}.csv"
end

#csv_countries_pathObject

routes for export / download (dl)



10
11
12
13
# File 'app/helpers/world_db_admin/routes_helper.rb', line 10

def csv_countries_path
  # dl_countries_path( format: 'csv' )
  '/api/v1/countries.csv'
end

#short_city_path(city) ⇒ Object



54
55
56
# File 'app/helpers/world_db_admin/routes_helper.rb', line 54

def short_city_path( city )
  short_city_worker_path( city.key )
end

#short_country_path(country, opts = {}) ⇒ Object

routes for shortcuts



46
47
48
# File 'app/helpers/world_db_admin/routes_helper.rb', line 46

def short_country_path( country, opts={} )
  short_country_worker_path( country.key, opts )
end

#short_region_path(region) ⇒ Object



50
51
52
# File 'app/helpers/world_db_admin/routes_helper.rb', line 50

def short_region_path( region )
  short_region_worker_path( region.country.key, region.key )
end

#short_tag_path(tag, opts = {}) ⇒ Object



58
59
60
61
# File 'app/helpers/world_db_admin/routes_helper.rb', line 58

def short_tag_path( tag, opts={} )
  ## NB: tag needs slug NOT key (key may contain spaces)
  short_tag_worker_path( tag.slug, opts )
end

#table_cities_pathObject



25
26
27
28
# File 'app/helpers/world_db_admin/routes_helper.rb', line 25

def table_cities_path
  # dl_cities_path( format: 'html' )
  '/api/v1/cities.html'
end

#table_countries_by_tag_path(tag) ⇒ Object



36
37
38
39
40
# File 'app/helpers/world_db_admin/routes_helper.rb', line 36

def table_countries_by_tag_path( tag )
  ## NB: tag needs slug NOT key (key may contain spaces)
  ## dl_countries_by_tag_worker_path( tag.slug, format: 'html')
  "/api/v1/tag/#{tag.slug}.html"
end

#table_countries_pathObject



15
16
17
18
# File 'app/helpers/world_db_admin/routes_helper.rb', line 15

def table_countries_path
  # dl_countries_path( format: 'html' )
  '/api/v1/countries.html'
end