Fix redirect_to :back deprecation warning
This commit is contained in:
@@ -9,7 +9,8 @@ class Admin::Legislation::HomepagesController < Admin::Legislation::BaseControll
|
|||||||
def update
|
def update
|
||||||
if @process.update(process_params)
|
if @process.update(process_params)
|
||||||
link = legislation_process_path(@process).html_safe
|
link = legislation_process_path(@process).html_safe
|
||||||
redirect_to :back, notice: t("admin.legislation.processes.update.notice", link: link)
|
redirect_back(fallback_location: (request.referrer || root_path),
|
||||||
|
notice: t("admin.legislation.processes.update.notice", link: link))
|
||||||
else
|
else
|
||||||
flash.now[:error] = t("admin.legislation.processes.update.error")
|
flash.now[:error] = t("admin.legislation.processes.update.error")
|
||||||
render :edit
|
render :edit
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class Admin::Poll::Questions::Answers::VideosController < Admin::Poll::BaseContr
|
|||||||
else
|
else
|
||||||
t("flash.actions.destroy.error")
|
t("flash.actions.destroy.error")
|
||||||
end
|
end
|
||||||
redirect_to :back, notice: notice
|
redirect_back(fallback_location: (request.referrer || root_path), notice: notice)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user