summaryrefslogtreecommitdiff
path: root/engines/support/app
diff options
context:
space:
mode:
Diffstat (limited to 'engines/support/app')
-rw-r--r--engines/support/app/controllers/tickets_controller.rb8
-rw-r--r--engines/support/app/helpers/auto_tickets_path_helper.rb3
-rw-r--r--engines/support/app/views/tickets/index.html.haml2
-rw-r--r--engines/support/app/views/tickets/new.html.haml2
-rw-r--r--engines/support/app/views/tickets/show.html.haml2
5 files changed, 9 insertions, 8 deletions
diff --git a/engines/support/app/controllers/tickets_controller.rb b/engines/support/app/controllers/tickets_controller.rb
index cf8743a..650f628 100644
--- a/engines/support/app/controllers/tickets_controller.rb
+++ b/engines/support/app/controllers/tickets_controller.rb
@@ -25,11 +25,11 @@ class TicketsController < ApplicationController
@ticket.email = current_user.email_address if current_user.email_address
if @ticket.save
flash[:notice] = t(:thing_was_successfully_created, :thing => t(:ticket))
- end
- # cannot set this until ticket has been saved, as @ticket.id will not be set
- if !logged_in? and flash[:notice]
- flash[:notice] += " " + t(:access_ticket_text, :full_url => ticket_url(@ticket.id))
+ # cannot set this until ticket has been saved, as @ticket.id will not be set
+ if !logged_in? and flash[:notice]
+ flash[:notice] += " " + t(:access_ticket_text, :full_url => ticket_url(@ticket.id))
+ end
end
respond_with(@ticket, :location => auto_ticket_path(@ticket))
end
diff --git a/engines/support/app/helpers/auto_tickets_path_helper.rb b/engines/support/app/helpers/auto_tickets_path_helper.rb
index 93f3cb9..5638222 100644
--- a/engines/support/app/helpers/auto_tickets_path_helper.rb
+++ b/engines/support/app/helpers/auto_tickets_path_helper.rb
@@ -23,6 +23,7 @@ module AutoTicketsPathHelper
end
def auto_ticket_path(ticket, options={})
+ return unless ticket.persisted?
options = ticket_view_options.merge options
if @user
user_ticket_path(@user, ticket, options)
@@ -50,4 +51,4 @@ module AutoTicketsPathHelper
hsh
end
-end \ No newline at end of file
+end
diff --git a/engines/support/app/views/tickets/index.html.haml b/engines/support/app/views/tickets/index.html.haml
index c02a326..a4df6e3 100644
--- a/engines/support/app/views/tickets/index.html.haml
+++ b/engines/support/app/views/tickets/index.html.haml
@@ -1,4 +1,4 @@
-- @show_navigation = !params[:user_id].nil?
+- @show_navigation = params[:user_id].present?
= render 'tickets/tabs'
diff --git a/engines/support/app/views/tickets/new.html.haml b/engines/support/app/views/tickets/new.html.haml
index 8a89703..65ed67b 100644
--- a/engines/support/app/views/tickets/new.html.haml
+++ b/engines/support/app/views/tickets/new.html.haml
@@ -1,4 +1,4 @@
-- @show_navigation = !params[:user_id].nil?
+- @show_navigation = params[:user_id].present?
= render 'tickets/tabs'
diff --git a/engines/support/app/views/tickets/show.html.haml b/engines/support/app/views/tickets/show.html.haml
index edb6e6f..4f3c127 100644
--- a/engines/support/app/views/tickets/show.html.haml
+++ b/engines/support/app/views/tickets/show.html.haml
@@ -1,4 +1,4 @@
-- @show_navigation = !params[:user_id].nil?
+- @show_navigation = params[:user_id].present?
.ticket
= render 'tickets/edit_form'