Class: Tasks::Nomenclature::OriginalCombinationController

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

Instance Method Summary (collapse)

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

- (Object) combination_params (protected)



23
24
25
# File 'app/controllers/tasks/nomenclature/original_combination_controller.rb', line 23

def combination_params
  params.require(:taxon_name).permit(related_taxon_name_relationships_attributes: [:type, :subject_taxon_name_id, :_destroy, :id] )
end

- (Object) edit



4
5
6
7
# File 'app/controllers/tasks/nomenclature/original_combination_controller.rb', line 4

def edit
  @taxon_name = TaxonName.find(params[:taxon_name_id])
  @original_combination_relations = @taxon_name.original_combination_relationships_and_stubs
end

- (Object) update



9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/tasks/nomenclature/original_combination_controller.rb', line 9

def update
  @taxon_name = TaxonName.find(params[:taxon_name_id])
  if @taxon_name.update(combination_params)
    flash[:notice] = "Successfully updated the original combination." 
    redirect_to @taxon_name.metamorphosize 
  else
    flash[:notice] = "The original combination information was NOT updated."
    redirect_to edit_protonym_original_combination_task_path(@taxon_name)
  end

end