diff --git a/app/helpers/tickets_helper.rb b/app/helpers/tickets_helper.rb index 3c60784..e7635f3 100644 --- a/app/helpers/tickets_helper.rb +++ b/app/helpers/tickets_helper.rb @@ -1,7 +1,9 @@ module TicketsHelper def smart_links_parser(html,site) - html = html.gsub("href=\"/uploads/","href=\"http://#{site.site_domain}/uploads/") - html = html.gsub("src=\"/uploads/","src=\"http://#{site.site_domain}/uploads/") + if !site.nil? + html = html.gsub("href=\"/uploads/","href=\"http://#{site.site_domain}/uploads/") + html = html.gsub("src=\"/uploads/","src=\"http://#{site.site_domain}/uploads/") + end return html end diff --git a/app/views/admin/tickets/_ticket.html.erb b/app/views/admin/tickets/_ticket.html.erb index 6bca2b0..b2345be 100644 --- a/app/views/admin/tickets/_ticket.html.erb +++ b/app/views/admin/tickets/_ticket.html.erb @@ -13,10 +13,12 @@ <%= ticket.subject %> - - - <%= ticket.registered_site.title %> - + <% if !ticket.registered_site.nil? %> + + + <%= ticket.registered_site.title %> + + <% end %>
<% if ticket.is_urgent? %> diff --git a/app/views/admin/tickets/_ticket_by_c.html.erb b/app/views/admin/tickets/_ticket_by_c.html.erb index 8991224..34d7ee7 100644 --- a/app/views/admin/tickets/_ticket_by_c.html.erb +++ b/app/views/admin/tickets/_ticket_by_c.html.erb @@ -9,7 +9,12 @@ %> <%= ticket_by_c.uid %> - <%= ticket_by_c.registered_site.title %> + + <% if !ticket_by_c.registered_site.nil? %> + <%= ticket_by_c.registered_site.title %> + <% end %> +   + <%= ticket_by_c.subject %> diff --git a/app/views/admin/tickets/show.html.erb b/app/views/admin/tickets/show.html.erb index e6068b5..1e00b1a 100644 --- a/app/views/admin/tickets/show.html.erb +++ b/app/views/admin/tickets/show.html.erb @@ -24,14 +24,16 @@ Back to Dashboard - - - <%= @ticket.registered_site.title %> - - - - Search tickets from <%= @ticket.registered_site.title %> - + <% if !@ticket.registered_site.nil? + + + <%= @ticket.registered_site.title %> + + + + Search tickets from <%= @ticket.registered_site.title %> + + <% end %>