diff --git a/app/controllers/phases_controller.rb b/app/controllers/phases_controller.rb index 0865211..0c21b97 100644 --- a/app/controllers/phases_controller.rb +++ b/app/controllers/phases_controller.rb @@ -156,7 +156,7 @@ if @phase.save redirect_to admin_show_phase_path(id: @phase.id, edit: 'true'), notice: _('Information was successfully created.') else - flash[:notice] = _('Unable to save your changes.') + flash[:notice] = generate_error_notice(@phase) @template = @phase.template render "admin_add" end @@ -172,7 +172,7 @@ redirect_to admin_show_phase_path(@phase), notice: _('Information was successfully updated.') else # Redirecting here because the method loads a lot of stuff. We may lose whatever the user had entered though - redirect_to admin_show_phase_path(id: @phase.id, edit: 'true'), notice: _('Unable to save your changes.') + redirect_to admin_show_phase_path(id: @phase.id, edit: 'true'), notice: generate_error_notice(@phase) end end diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 53d948a..75f9aab 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -172,7 +172,7 @@ end redirect_to admin_template_template_path(), notice: _('Information was successfully updated.') else - redirect_to admin_template_template_path(@template), notice: _('Unable to save your changes.') + redirect_to admin_template_template_path(@template), notice: generate_error_notice(@template) end end @@ -204,7 +204,7 @@ if @template.save redirect_to admin_template_template_path(@template), notice: _('Information was successfully created.') else - flash[:notice] = _('Unable to save your changes.') + flash[:notice] = generate_error_notice(@template) render action: "admin_new" end end