mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-12 16:14:58 +08:00
Merge pull request #160 from ZmagoD/zd_SCI_464
Fixes restore experiment error [fixes SCI-464]
This commit is contained in:
commit
5fedcb4be2
1 changed files with 8 additions and 0 deletions
|
@ -76,16 +76,24 @@ class ExperimentsController < ApplicationController
|
|||
@experiment.touch(:workflowimg_updated_at)
|
||||
flash[:success] = t('experiments.update.success_flash',
|
||||
experiment: @experiment.name)
|
||||
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
render json: {}, status: :ok
|
||||
end
|
||||
format.html do
|
||||
redirect_to project_path(@experiment.project)
|
||||
end
|
||||
end
|
||||
else
|
||||
flash[:alert] = t('experiments.update.error_flash')
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
render json: @experiment.errors, status: :unprocessable_entity
|
||||
end
|
||||
format.html do
|
||||
redirect_to :back
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue