summaryrefslogtreecommitdiff
path: root/help/app
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-11-11 14:16:16 -0800
committerjessib <jessib@riseup.net>2013-11-11 14:16:16 -0800
commitd70161b55e37e0d9e7a23ed7dbac4ea6d323971a (patch)
treeb45b2670f267a4099ae645c0b5ea413ed516025e /help/app
parentd4d970095d0370d7d5744fdc0ebc7b8d9bbd1a4c (diff)
Maybe not ideal fix, but since there is no edit view, we want to show the show view with the appropriate error messages.
Diffstat (limited to 'help/app')
-rw-r--r--help/app/controllers/tickets_controller.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/help/app/controllers/tickets_controller.rb b/help/app/controllers/tickets_controller.rb
index a669e19..c193ff4 100644
--- a/help/app/controllers/tickets_controller.rb
+++ b/help/app/controllers/tickets_controller.rb
@@ -62,14 +62,11 @@ class TicketsController < ApplicationController
@ticket.comments.last.private = false unless admin?
end
- if @ticket.changed?
- if @ticket.save
- flash[:notice] = t(:changes_saved)
- redirect_to_tickets
- else
- respond_with @ticket
- end
+ if @ticket.changed? and @ticket.save
+ flash[:notice] = t(:changes_saved)
+ redirect_to_tickets
else
+ flash[:error] = @ticket.errors.full_messages.join(". ") if @ticket.changed?
redirect_to auto_ticket_path(@ticket)
end
end