mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-27 10:08:11 +08:00
byTheWay fix of Rails 5.1 bug
This commit is contained in:
parent
29f9414839
commit
e577b363b2
8 changed files with 12 additions and 12 deletions
|
@ -131,7 +131,7 @@ class ExperimentsController < ApplicationController
|
|||
render json: @experiment.errors, status: :unprocessable_entity
|
||||
end
|
||||
format.html do
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -159,7 +159,7 @@ class ExperimentsController < ApplicationController
|
|||
redirect_to project_path(@experiment.project)
|
||||
else
|
||||
flash[:alert] = t('experiments.archive.error_flash')
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -267,7 +267,7 @@ class RepositoriesController < ApplicationController
|
|||
else
|
||||
flash[:alert] = t('zip_export.export_error')
|
||||
end
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -326,7 +326,7 @@ class RepositoriesController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.html do
|
||||
flash[:alert] = message
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
format.json do
|
||||
render json: { message: message },
|
||||
|
|
|
@ -109,7 +109,7 @@ class SampleGroupsController < ApplicationController
|
|||
sample.update(sample_group_id: nil)
|
||||
end
|
||||
@sample_group.destroy
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -95,7 +95,7 @@ class SampleTypesController < ApplicationController
|
|||
sample.update(sample_type_id: nil)
|
||||
end
|
||||
@sample_type.destroy
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
|
||||
def sample_type_element
|
||||
|
|
|
@ -54,11 +54,11 @@ class SearchController < ApplicationController
|
|||
if query.length < Constants::NAME_MIN_LENGTH
|
||||
flash[:error] = t('general.query.length_too_short',
|
||||
min_length: Constants::NAME_MIN_LENGTH)
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
elsif query.length > Constants::TEXT_MAX_LENGTH
|
||||
flash[:error] = t('general.query.length_too_long',
|
||||
max_length: Constants::TEXT_MAX_LENGTH)
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
else
|
||||
@search_query = query
|
||||
end
|
||||
|
@ -76,7 +76,7 @@ class SearchController < ApplicationController
|
|||
flash[:error] = t('general.query.wrong_query',
|
||||
min_length: Constants::NAME_MIN_LENGTH,
|
||||
max_length: Constants::TEXT_MAX_LENGTH)
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
else
|
||||
@search_query.strip!
|
||||
end
|
||||
|
|
|
@ -217,7 +217,7 @@ class TeamsController < ApplicationController
|
|||
else
|
||||
flash[:alert] = t('zip_export.export_error')
|
||||
end
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
|
||||
def routing_error(error = 'Routing error', status = :not_found, exception=nil)
|
||||
|
|
|
@ -72,7 +72,7 @@ module Users
|
|||
flash[:alert] = t(
|
||||
'users.settings.account.preferences.tutorial.tutorial_reset_error'
|
||||
)
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ module Users
|
|||
end
|
||||
end
|
||||
flash[:alert] = t('users.settings.changed_team_error_flash')
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue