Using redirect_to :back

This commit is contained in:
Christoph Haas 2016-06-13 17:56:12 +02:00
parent 0d3dfdff94
commit 5bffa5dfbb

View file

@ -57,8 +57,8 @@ class PackagesController < ApplicationController
if user_can_alter_screenshot?
@screenshot.destroy
redirect_to package_path
flash['notice'] = "Screenshot deleted."
redirect_to :back
else
head :forbidden
end
@ -99,7 +99,7 @@ class PackagesController < ApplicationController
@screenshot.description = params[:description]
@screenshot.save!
flash['notice'] = "Description updated."
redirect_to package_path
redirect_to :back
end
# Receive an anonymous report from a user to have a screenshot removed.
@ -109,7 +109,7 @@ class PackagesController < ApplicationController
@screenshot.markedfordelete = true
@screenshot.save!
flash['notice'] = "Screenshot reported. The moderators will deal with it."
redirect_to package_path
redirect_to :back
end
private