From ea1dbc1d0de42b0d8290723ae86494204b4e4229 Mon Sep 17 00:00:00 2001 From: Bilel Kihal <61744974+Bilelkihal@users.noreply.github.com> Date: Thu, 30 May 2024 16:47:02 +0200 Subject: [PATCH] feature: use the ontologies selector by name and acronym in edit groups and categories (#641) --- app/controllers/admin/categories_controller.rb | 2 +- app/controllers/admin/groups_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/categories_controller.rb b/app/controllers/admin/categories_controller.rb index ffe23c076b..9a4e357c98 100644 --- a/app/controllers/admin/categories_controller.rb +++ b/app/controllers/admin/categories_controller.rb @@ -24,7 +24,7 @@ def new def edit @category = _category @acronyms = @category.ontologies.map { |url| url.match(/\/([^\/]+)$/)[1] } - @ontologies_category = LinkedData::Client::Models::Ontology.all(include: 'acronym').map {|o|[o.acronym, o.id] } + @ontologies_category = LinkedData::Client::Models::Ontology.all(include: 'name,acronym').map {|x| ["#{x.name} (#{x.acronym})", x.id.to_s]} respond_to do |format| format.html { render "edit", :layout => false } end diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb index 3fdbd5ef35..d4ae613520 100644 --- a/app/controllers/admin/groups_controller.rb +++ b/app/controllers/admin/groups_controller.rb @@ -24,7 +24,7 @@ def new def edit @group = LinkedData::Client::Models::Group.find_by_acronym(params[:id]).first @acronyms = @group&.ontologies&.map { |url| url.match(/\/([^\/]+)$/)[1] } - @ontologies_group = LinkedData::Client::Models::Ontology.all(include: 'acronym').map {|o|[o.acronym, o.id] } + @ontologies_group = LinkedData::Client::Models::Ontology.all(include: 'name,acronym').map {|x| ["#{x.name} (#{x.acronym})", x.id.to_s]} respond_to do |format| format.html { render "edit", :layout => false } end