add admin flash messaging and styles

This commit is contained in:
Mark Moser
2016-08-24 12:15:12 -05:00
parent 35f33e8215
commit 0058168c3e
8 changed files with 36 additions and 7 deletions

View File

@ -14,7 +14,7 @@ module Admin
@question = Question.create(process_question_params)
if @question.persisted?
redirect_to admin_questions_path, flash: { notice: "Sucessfully created question" }
redirect_to admin_questions_path, flash: { success: "Sucessfully created question" }
else
flash[:error] = "Failed to save question."
render :new
@ -36,7 +36,7 @@ module Admin
if @question.update_attributes(process_question_params)
redirect_to admin_question_path(@question.to_i),
flash: { notice: "Sucessfully updated question" }
flash: { success: "Sucessfully updated question" }
else
flash[:error] = "Failed to update question."
render :edit

View File

@ -14,7 +14,7 @@ module Admin
if @user.persisted?
# TODO: UserMailer.welcome(@user, default_passwd).deliver_now
redirect_to admin_users_path, flash: { notice: "Sucessfully created user #{@user.name}" }
redirect_to admin_users_path, flash: { success: "Sucessfully created user #{@user.name}" }
else
flash[:error] = "Failed to save user."
render :new
@ -34,7 +34,7 @@ module Admin
if @user.update_attributes(user_params)
redirect_to admin_user_path(@user.to_i),
flash: { notice: "Sucessfully updated #{@user.name}" }
flash: { success: "Sucessfully updated #{@user.name}" }
else
flash[:error] = "Failed to update user."
render :edit