Add flash type error.Rewrite controllers to use common flash style with redirect_to

This commit is contained in:
Nishanth Vijayan 2016-03-10 14:25:38 +05:30
parent dcdceb7c6d
commit 434eb90b76
16 changed files with 81 additions and 85 deletions

View file

@ -18,8 +18,9 @@ module Admin
redirect_to admin_conference_commercials_path,
notice: 'Commercial was successfully created.'
else
flash[:error] = "An error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
redirect_to admin_conference_commercials_path
redirect_to admin_conference_commercials_path,
error: 'An error prohibited this Commercial from being saved: '\
"#{@commercial.errors.full_messages.join('. ')}."
end
end
@ -29,8 +30,9 @@ module Admin
redirect_to admin_conference_commercials_path,
notice: 'Commercial was successfully updated.'
else
flash[:error] = "An error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
redirect_to admin_conference_commercials_path
redirect_to admin_conference_commercials_path,
error: 'An error prohibited this Commercial from being saved: '\
"#{@commercial.errors.full_messages.join('. ')}."
end
end