From d70161b55e37e0d9e7a23ed7dbac4ea6d323971a Mon Sep 17 00:00:00 2001 From: jessib Date: Mon, 11 Nov 2013 14:16:16 -0800 Subject: Maybe not ideal fix, but since there is no edit view, we want to show the show view with the appropriate error messages. --- help/app/controllers/tickets_controller.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'help') 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 -- cgit v1.2.3