Skip to content

Commit

Permalink
make ontology controller classes action find the current concept simply
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jul 22, 2023
1 parent 4b25bae commit 427b521
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/ontologies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,13 @@ def index

def classes
@submission = get_ontology_submission_ready(@ontology)
get_class(params)

if ignore_concept_param?(params)
@concept = @ontology.explore.roots.min { |x, y| x.prefLabel&.downcase <=> y.prefLabel&.downcase }
@concept ||= @ontology.explore.classes.collection.first
else
@concept = @ontology.explore.classes({full: true, lang: request_lang}, params[:conceptid])
end

if @submission.hasOntologyLanguage == 'SKOS'
@schemes = get_schemes(@ontology)
Expand Down

0 comments on commit 427b521

Please sign in to comment.