Sha256: e7a8959be40773889d851b1fc008a2d65a11fec0edbf93aa548afaacf918a6cd

Contents?: true

Size: 543 Bytes

Versions: 7

Compression:

Stored size: 543 Bytes

Contents

# frozen_string_literal: true

class DivisionsController < ApplicationController
  before_action :set_breadcrumbs

  def index
    @divisions = if @region
      @region.divisions.order(:id)
    else
      USGeo::Division.not_removed.order(:id)
    end
  end

  def show
    @division = USGeo::Division.find(params[:id])
    add_breadcrumb(division_id: @division)
  end

  private

  def set_breadcrumbs
    if params[:region_id]
      @region = USGeo::Region.find(params[:region_id])
      add_breadcrumb(region_id: @region)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
us_geo-2.1.1 explorer_app/app/controllers/divisions_controller.rb
us_geo-2.1.0 explorer_app/app/controllers/divisions_controller.rb
us_geo-2.0.4 explorer_app/app/controllers/divisions_controller.rb
us_geo-2.0.3 explorer_app/app/controllers/divisions_controller.rb
us_geo-2.0.2 explorer_app/app/controllers/divisions_controller.rb
us_geo-2.0.1 explorer_app/app/controllers/divisions_controller.rb
us_geo-2.0.0 explorer_app/app/controllers/divisions_controller.rb