Class: Tasks::Gis::OtuDistributionDataController

Inherits:
ApplicationController
  • Object
show all
Includes:
TaskControllerConfiguration
Defined in:
app/controllers/tasks/gis/otu_distribution_data_controller.rb

Instance Method Summary (collapse)

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

- (Object) show

show_for_otu



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/tasks/gis/otu_distribution_data_controller.rb', line 5

def show
  id = params[:id]
  if id.blank?
    @otu = Otu.first
  else
    @otu = Otu.find(id)
  end
  @taxon_name   = @otu.taxon_name
  @distribution = Distribution.new(otus: Otu.where(id: @otu.id).page(params[:page]))
  @type_tag     = 'Otu'
  render('show')
end

- (Object) show_for_taxon_name



18
19
20
21
22
23
# File 'app/controllers/tasks/gis/otu_distribution_data_controller.rb', line 18

def show_for_taxon_name
  @taxon_name   = TaxonName.find(params[:id])
  @distribution = Distribution.new(otus: Otu.for_taxon_name(@taxon_name).page(params[:page]).per(10))
  @type_tag     = 'Taxon name'
  render('show')
end