Commit 4b08a41c53b6a9ace6e51ef7fe008bc7aacc9b41

Authored by Stephen Crosby
2 parents ae91fcb5 88643e23
Exists in master

Merge pull request #1056 from mfrederickson/controller-flash-fix

closes #1053 don't carry forward flash notices
Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
app/controllers/apps_controller.rb
@@ -53,7 +53,7 @@ class AppsController < ApplicationController @@ -53,7 +53,7 @@ class AppsController < ApplicationController
53 if app.save 53 if app.save
54 redirect_to app_url(app), flash: { success: I18n.t('controllers.apps.flash.create.success') } 54 redirect_to app_url(app), flash: { success: I18n.t('controllers.apps.flash.create.success') }
55 else 55 else
56 - flash[:error] = I18n.t('controllers.apps.flash.create.error') 56 + flash.now[:error] = I18n.t('controllers.apps.flash.create.error')
57 render :new 57 render :new
58 end 58 end
59 end 59 end
@@ -63,7 +63,7 @@ class AppsController < ApplicationController @@ -63,7 +63,7 @@ class AppsController < ApplicationController
63 if app.save 63 if app.save
64 redirect_to app_url(app), flash: { success: I18n.t('controllers.apps.flash.update.success') } 64 redirect_to app_url(app), flash: { success: I18n.t('controllers.apps.flash.update.success') }
65 else 65 else
66 - flash[:error] = I18n.t('controllers.apps.flash.update.error') 66 + flash.now[:error] = I18n.t('controllers.apps.flash.update.error')
67 render :edit 67 render :edit
68 end 68 end
69 end 69 end
@@ -76,7 +76,7 @@ class AppsController < ApplicationController @@ -76,7 +76,7 @@ class AppsController < ApplicationController
76 if app.destroy 76 if app.destroy
77 redirect_to apps_url, flash: { success: I18n.t('controllers.apps.flash.destroy.success') } 77 redirect_to apps_url, flash: { success: I18n.t('controllers.apps.flash.destroy.success') }
78 else 78 else
79 - flash[:error] = I18n.t('controllers.apps.flash.destroy.error') 79 + flash.now[:error] = I18n.t('controllers.apps.flash.destroy.error')
80 render :show 80 render :show
81 end 81 end
82 end 82 end