s/redirect_to :back/redirect_back/
`redirect_to` has been removed in Rails 5.1 in favor of: ``` redirect_back(fallback_location: root_path) ```
This commit is contained in:
parent
ca32024268
commit
41d6fad7a5
5 changed files with 6 additions and 7 deletions
|
|
@ -88,10 +88,9 @@ module ApplicationHelper
|
|||
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
|
||||
redirect_back(fallback_location: root_path)
|
||||
else
|
||||
redirect_to options, response_status
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue