Add success message when creating/updating banners
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -36,12 +36,16 @@ en:
|
||||
budgets: Participatory budgeting
|
||||
help_page: Help page
|
||||
sdg: SDG
|
||||
create:
|
||||
notice: "Banner created successfully"
|
||||
edit:
|
||||
editing: Edit banner
|
||||
form:
|
||||
submit_button: Save changes
|
||||
new:
|
||||
creating: Create banner
|
||||
update:
|
||||
notice: "Banner updated successfully"
|
||||
activity:
|
||||
show:
|
||||
action: Action
|
||||
|
||||
@@ -36,12 +36,16 @@ es:
|
||||
budgets: Presupuestos participativos
|
||||
help_page: Página de ayuda
|
||||
sdg: ODS
|
||||
create:
|
||||
notice: "Banner creado correctamente"
|
||||
edit:
|
||||
editing: Editar el banner
|
||||
form:
|
||||
submit_button: Guardar cambios
|
||||
new:
|
||||
creating: Crear banner
|
||||
update:
|
||||
notice: "Banner actualizado correctamente"
|
||||
activity:
|
||||
show:
|
||||
action: Acción
|
||||
|
||||
@@ -88,7 +88,7 @@ describe "Admin banners magement", :admin do
|
||||
|
||||
click_button "Save changes"
|
||||
|
||||
expect(page).to have_content "Such banner"
|
||||
expect(page).to have_content "Banner created successfully"
|
||||
|
||||
visit proposals_path
|
||||
|
||||
@@ -158,7 +158,8 @@ describe "Admin banners magement", :admin do
|
||||
|
||||
click_button "Save changes"
|
||||
|
||||
visit admin_banners_path
|
||||
expect(page).to have_content "Banner updated successfully"
|
||||
|
||||
expect(page).to have_content "Modified title"
|
||||
expect(page).to have_content "Edited text"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user