ontology_versions_controller.rb revision c1d8e2d429e199cfca7964aedbdb16c6b170f9ee
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen# Displays versions of a ontology
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainenclass OntologyVersionsController < InheritedResources::Base
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen defaults :collection_name => :versions, :finder => :find_by_number!
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen before_filter :check_changeable, only: [:new, :create]
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen # TODO Needs testing !!!
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen send_file file.current_path, filename: file.identifier
9ddd3d7d8651985e373a6c48e0ddc76b8a4ef1c7Timo Sirainen redirect_to collection_path, flash: { error: "The file was not found: #{e.message}" }
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen build_resource.source_url = collection.latest.first.source_url
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen flash[:notice] = "Your request is send to OOPS!"
d8702d15ee7721ed1fcfc8f00a589970bd6b3598Timo Sirainen redirect_to collection_path, flash: { error: 'There are pending ontology versions.' }