mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 06:01:12 +00:00
Merge pull request #472 from ChrisBr/adds_error_message_to_questions
Adds error message to questions controller
This commit is contained in:
commit
e41fa41acf
1 changed files with 2 additions and 2 deletions
|
|
@ -24,7 +24,7 @@ module Admin
|
||||||
if @conference.save
|
if @conference.save
|
||||||
format.html { redirect_to admin_conference_questions_path, notice: 'Question was successfully created.' }
|
format.html { redirect_to admin_conference_questions_path, notice: 'Question was successfully created.' }
|
||||||
else
|
else
|
||||||
flash[:error] = "Oops, couldn't save. Question and answer(s) have titles?"
|
flash[:error] = "Oops, couldn't save Question. #{@question.errors.full_messages.join('. ')}"
|
||||||
format.html { redirect_to admin_conference_questions_path }
|
format.html { redirect_to admin_conference_questions_path }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -42,7 +42,7 @@ module Admin
|
||||||
if @question.update_attributes(params[:question])
|
if @question.update_attributes(params[:question])
|
||||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Question '#{@question.title}' for #{@conference.short_title} successfully updated.")
|
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Question '#{@question.title}' for #{@conference.short_title} successfully updated.")
|
||||||
else
|
else
|
||||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed.")
|
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed. #{@question.errors.full_messages.join('. ')}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue