From 4a195e07c42f5c177e33ef15f89ea1157ed9cb5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Sat, 18 Feb 2017 13:23:29 +0100 Subject: [PATCH] improves notice/alert messages on poll recounting --- app/controllers/officing/final_recounts_controller.rb | 8 ++++---- app/controllers/officing/recounts_controller.rb | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/officing/final_recounts_controller.rb b/app/controllers/officing/final_recounts_controller.rb index bbfa13c95..e381240e7 100644 --- a/app/controllers/officing/final_recounts_controller.rb +++ b/app/controllers/officing/final_recounts_controller.rb @@ -20,11 +20,11 @@ class Officing::FinalRecountsController < Officing::BaseController @final_recount.count = final_recount_params[:count] if @final_recount.save - notice = t("officing.final_recounts.flash.create") + msg = { notice: t("officing.final_recounts.flash.create") } else - notice = t("officing.final_recounts.flash.error_create") + msg = { alert: t("officing.final_recounts.flash.error_create") } end - redirect_to new_officing_poll_final_recount_path(@poll), notice: notice + redirect_to new_officing_poll_final_recount_path(@poll), msg end private @@ -36,7 +36,7 @@ class Officing::FinalRecountsController < Officing::BaseController @officer_assignment = current_user.poll_officer. officer_assignments.final.find_by(id: final_recount_params[:officer_assignment_id]) if @officer_assignment.blank? - redirect_to new_officing_poll_final_recount_path(@poll), notice: t("officing.final_recounts.flash.error_create") + redirect_to new_officing_poll_final_recount_path(@poll), alert: t("officing.final_recounts.flash.error_create") end end diff --git a/app/controllers/officing/recounts_controller.rb b/app/controllers/officing/recounts_controller.rb index 62e955d5c..1c66e57fd 100644 --- a/app/controllers/officing/recounts_controller.rb +++ b/app/controllers/officing/recounts_controller.rb @@ -19,11 +19,11 @@ class Officing::RecountsController < Officing::BaseController @recount.count = recount_params[:count] if @recount.save - notice = t("officing.recounts.flash.create") + msg = { notice: t("officing.recounts.flash.create") } else - notice = t("officing.recounts.flash.error_create") + msg = { alert: t("officing.recounts.flash.error_create") } end - redirect_to new_officing_poll_recount_path(@poll), notice: notice + redirect_to new_officing_poll_recount_path(@poll), msg end private @@ -35,7 +35,7 @@ class Officing::RecountsController < Officing::BaseController @officer_assignment = current_user.poll_officer. officer_assignments.find_by(id: recount_params[:officer_assignment_id]) if @officer_assignment.blank? - redirect_to new_officing_poll_recount_path(@poll), notice: t("officing.recounts.flash.error_create") + redirect_to new_officing_poll_recount_path(@poll), alert: t("officing.recounts.flash.error_create") end end