use flash.now instead of flash where page is rendered in the same controller methods

This commit is contained in:
Eugene Dubinin 2017-04-03 18:34:37 +03:00
parent d90d2344d6
commit b7bdb29cbe
23 changed files with 39 additions and 39 deletions

View file

@ -40,7 +40,7 @@ class ProposalsController < ApplicationController
if @user.save
sign_in(@user)
else
flash[:error] = "Could not save user: #{@user.errors.full_messages.join(', ')}"
flash.now[:error] = "Could not save user: #{@user.errors.full_messages.join(', ')}"
render action: 'new'
return
end
@ -57,7 +57,7 @@ class ProposalsController < ApplicationController
ahoy.track 'Event submission', title: 'New submission'
redirect_to conference_program_proposals_path(@conference.short_title), notice: 'Proposal 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
@ -69,7 +69,7 @@ class ProposalsController < ApplicationController
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
notice: 'Proposal was successfully updated.'
else
flash[:error] = "Could not update proposal: #{@event.errors.full_messages.join(', ')}"
flash.now[:error] = "Could not update proposal: #{@event.errors.full_messages.join(', ')}"
render action: 'edit'
end
end