Add success message when creating/updating banners

This commit is contained in:
Javi Martín
2021-03-27 18:07:01 +01:00
parent 5612ada2d4
commit 2036b3d44e
4 changed files with 13 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ class Admin::BannersController < Admin::BaseController
def create
@banner = Banner.new(banner_params)
if @banner.save
redirect_to admin_banners_path
redirect_to admin_banners_path, notice: t("admin.banners.create.notice")
else
render :new
end
@@ -24,7 +24,7 @@ class Admin::BannersController < Admin::BaseController
def update
if @banner.update(banner_params)
redirect_to admin_banners_path
redirect_to admin_banners_path, notice: t("admin.banners.update.notice")
else
render :edit
end