Skip to content

Commit

Permalink
feature: use the ontologies selector by name and acronym in edit grou…
Browse files Browse the repository at this point in the history
…ps and categories (#641)
  • Loading branch information
Bilelkihal committed Jun 14, 2024
1 parent 2bb0360 commit ea1dbc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/categories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ea1dbc1

Please sign in to comment.