Class: Tasks::TaxonNames::MergeController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Tasks::TaxonNames::MergeController
- Includes:
- TaskControllerConfiguration
- Defined in:
- app/controllers/tasks/taxon_names/merge_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
GET.
-
#merge ⇒ Object
POST.
-
#report ⇒ Object
GET.
Methods included from TaskControllerConfiguration
Instance Method Details
#index ⇒ Object
GET
5 6 |
# File 'app/controllers/tasks/taxon_names/merge_controller.rb', line 5 def index end |
#merge ⇒ Object
POST
15 16 17 18 19 20 21 |
# File 'app/controllers/tasks/taxon_names/merge_controller.rb', line 15 def merge @from_taxon_name = TaxonName.where(project_id: sessions_current_project_id).find(params.require(:from_taxon_name_id)) @to_taxon_name = TaxonName.where(project_id: sessions_current_project_id).find(params.require(:to_taxon_name_id)) @result = @from_taxon_name.merge_to(@to_taxon_name, params.require(:kind).to_sym) render 'report', status: :ok and return end |
#report ⇒ Object
GET
9 10 11 12 |
# File 'app/controllers/tasks/taxon_names/merge_controller.rb', line 9 def report @from_taxon_name = TaxonName.where(project_id: sessions_current_project_id, id: params[:from_taxon_name_id]).first @to_taxon_name = TaxonName.where(project_id: sessions_current_project_id, id: params[:to_taxon_name_id]).first end |