fix flashes staying on the page

This commit is contained in:
pixeldesu 2015-07-17 21:34:53 +02:00
parent a122106d82
commit 8232aa2a21
1 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ class InboxController < ApplicationController
.where(questions: { user_id: @target_user.id, author_is_anonymous: false })
.count
if @inbox_author.empty?
flash[:info] = "No questions from @#{params[:author]} found, showing default entries instead!"
flash.now[:info] = "No questions from @#{params[:author]} found, showing default entries instead!"
@inbox
@inbox_count
else
@ -25,7 +25,7 @@ class InboxController < ApplicationController
@inbox_count = @inbox_author_count
end
rescue
flash[:error] = "No user with the name @#{params[:author]} found, showing default entries instead!"
flash.now[:error] = "No user with the name @#{params[:author]} found, showing default entries instead!"
@inbox
@inbox_count
end