Sha256: 06a538aebc832a136642a934094c074b6ef5d0d5ee59a6578f1b1d763ee96967

Contents?: true

Size: 541 Bytes

Versions: 5

Compression:

Stored size: 541 Bytes

Contents

# frozen_string_literal: true

class UrbanAreasController < ApplicationController
  def index
    urban_areas = USGeo::UrbanArea.not_removed

    @tab = params[:tab]
    if @tab.present?
      type = if @tab == "urbanized"
        "UrbanizedArea"
      elsif @tab == "cluster"
        "UrbanCluster"
      end
      urban_areas = urban_areas.where(type: type)
    end

    @urban_areas = urban_areas.order(:name)
  end

  def show
    @urban_area = USGeo::UrbanArea.find(params[:id])
    add_breadcrumb(urban_area_id: @urban_area)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
us_geo-2.0.4 explorer_app/app/controllers/urban_areas_controller.rb
us_geo-2.0.3 explorer_app/app/controllers/urban_areas_controller.rb
us_geo-2.0.2 explorer_app/app/controllers/urban_areas_controller.rb
us_geo-2.0.1 explorer_app/app/controllers/urban_areas_controller.rb
us_geo-2.0.0 explorer_app/app/controllers/urban_areas_controller.rb