From 89509519eff3c791ba81dea92b53ddc4dc43a283 Mon Sep 17 00:00:00 2001 From: rahul Date: Mon, 28 Aug 2017 22:31:24 +0530 Subject: [PATCH] Replace flash with flash.now --- app/controllers/admin/booths_controller.rb | 4 ++-- app/controllers/admin/events_controller.rb | 2 +- app/controllers/booths_controller.rb | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/admin/booths_controller.rb b/app/controllers/admin/booths_controller.rb index a65de090..102eb10b 100644 --- a/app/controllers/admin/booths_controller.rb +++ b/app/controllers/admin/booths_controller.rb @@ -22,7 +22,7 @@ module Admin redirect_to admin_conference_booths_path, notice: 'Booth successfully created.' else - flash[:error] = "Creating booth failed. #{@booth.errors.full_messages.to_sentence}." + flash.now[:error] = "Creating booth failed. #{@booth.errors.full_messages.to_sentence}." render :new end end @@ -40,7 +40,7 @@ module Admin redirect_to admin_conference_booths_path, notice: "Successfully updated booth for #{@booth.title}." else - flash[:error] = "An error prohibited the Booth for #{@booth.title} "\ + flash.now[:error] = "An error prohibited the Booth for #{@booth.title} "\ "#{@booth.errors.full_messages.join('. ')}." render :edit end diff --git a/app/controllers/admin/events_controller.rb b/app/controllers/admin/events_controller.rb index bb23dac9..accfb281 100644 --- a/app/controllers/admin/events_controller.rb +++ b/app/controllers/admin/events_controller.rb @@ -102,7 +102,7 @@ module Admin ahoy.track 'Event submission', title: 'New submission' redirect_to admin_conference_program_events_path(@conference.short_title), notice: 'Event was successfully submitted.' else - flash[:error] = "Could not submit proposal: #{@event.errors.full_messages.join(', ')}" + flash.now[:error] = "Could not submit proposal: #{@event.errors.full_messages.join(', ')}" render action: 'new' end end diff --git a/app/controllers/booths_controller.rb b/app/controllers/booths_controller.rb index 99fde3bc..f0457b88 100644 --- a/app/controllers/booths_controller.rb +++ b/app/controllers/booths_controller.rb @@ -23,7 +23,7 @@ class BoothsController < ApplicationController redirect_to conference_booths_path, notice: 'Booth successfully created.' else - flash[:error] = "Creating booth failed. #{@booth.errors.full_messages.to_sentence}." + flash.now[:error] = "Creating booth failed. #{@booth.errors.full_messages.to_sentence}." render :new end end @@ -40,7 +40,7 @@ class BoothsController < ApplicationController redirect_to conference_booths_path, notice: 'Booth successfully updated!' else - flash[:error] = "Booth could not be updated. #{@booth.errors.full_messages.to_sentence}." + flash.now[:error] = "Booth could not be updated. #{@booth.errors.full_messages.to_sentence}." end end @@ -56,7 +56,7 @@ class BoothsController < ApplicationController redirect_to conference_booths_path, notice: 'Booth successfully withdrawn' else - flash[:error] = "Booth could not be withdrawn. #{@booth.errors.full_messages.to_sentence}." + flash.now[:error] = "Booth could not be withdrawn. #{@booth.errors.full_messages.to_sentence}." end end @@ -70,7 +70,7 @@ class BoothsController < ApplicationController redirect_to conference_booths_path, notice: 'Booth successfully confirmed' else - flash[:error] = "Booth could not be confirmed. #{@booth.errors.full_messages.to_sentence}." + flash.now[:error] = "Booth could not be confirmed. #{@booth.errors.full_messages.to_sentence}." end end @@ -84,7 +84,7 @@ class BoothsController < ApplicationController redirect_to conference_booths_path, notice: 'Booth successfully re-submitted' else - flash[:error] = "Booth could not be re-submitted. #{@booth.errors.full_messages.to_sentence}." + flash.now[:error] = "Booth could not be re-submitted. #{@booth.errors.full_messages.to_sentence}." end end