app/controllers/taxa/names_controller.rb
# PUT /pages/:taxon_id/names currently only used to update common_names
PUT /pages/:taxon_id/names currently only used to update common_names
PUT / pages / : taxon_id / names currently only used to update common_names
def update
    if current_user.is_curator?
      if params[:preferred_name_id]
        name = Name.find(params[:preferred_name_id])
        language = Language.find(params[:language_id])
        @taxon_concept.add_common_name_synonym(name.string, agent: current_user.agent, language: language, preferred: 1, vetted: Vetted.trusted)
        expire_taxa([@taxon_concept.id])
      end
    end
    if !params[:hierarchy_entry_id].blank?
      redirect_to common_names_taxon_entry_names_path(@taxon_concept, params[:hierarchy_entry_id]), status: :moved_permanently
    else
      redirect_to common_names_taxon_names_path(@taxon_concept), status: :moved_permanently
    end
  end
def update if current_user . is_curator? if params [ :preferred_name_id ] name = Name . find ( params [ :preferred_name_id ] ) language = Language . find ( params [ :language_id ] ) @taxon_concept . add_common_name_synonym ( name . string , agent : current_user . agent , language : language , preferred : 1 , vetted : Vetted . trusted ) expire_taxa ( [ @taxon_concept . id ] ) end end if ! params [ :hierarchy_entry_id ] . blank? redirect_to common_names_taxon_entry_names_path ( @taxon_concept , params [ :hierarchy_entry_id ] ) , status : :moved_permanently else redirect_to common_names_taxon_names_path ( @taxon_concept ) , status : :moved_permanently end end
PUT /pages/:taxon_id/names currently only used to update common_names
PUT / pages / : taxon_id / names currently only used to update common_names