rearrange helper functions

This commit is contained in:
hitman 2017-03-10 02:18:26 +05:30 committed by Stella Rouzi
parent f63259f187
commit 5b1a730e19
5 changed files with 30 additions and 71 deletions

View file

@ -30,13 +30,4 @@ module PathsHelper
return ''
end
end
# Same as redirect_to(:back) if there is a valid HTTP referer, otherwise redirect_to()
def redirect_back_or_to(options = {}, response_status = {})
if request.env['HTTP_REFERER']
redirect_to :back
else
redirect_to options, response_status
end
end
end