Class: Tasks::AssertedDistributions::BasicEndemismController

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

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#indexObject

GET


5
6
7
8
9
10
11
12
13
# File 'app/controllers/tasks/asserted_distributions/basic_endemism_controller.rb', line 5

def index
  @taxon_name = TaxonName.where(project_id: sessions_current_project_id).find(params[:taxon_name_id]) if params[:taxon_name_id]
  @taxon_name ||= sessions_current_project.root_taxon_name

  @geographic_area = GeographicArea.find(params[:geographic_area_id]) if params[:geographic_area_id]
  @geographic_area ||= GeographicArea.first

  @data = TaxonWorks::Analysis::AssertedDistribution::BasicEndemism.quick_endemism(@taxon_name, @geographic_area)
end