From 5a1b885dd620e6ab465c0f64b7cd0f025a46fb37 Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Mon, 31 Dec 2012 14:36:23 -0500 Subject: Add style to AV::Template::Error exception page --- actionpack/lib/action_dispatch/middleware/exception_wrapper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/middleware/exception_wrapper.rb') diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb index d1cadbd082..ee69c8b49d 100644 --- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb @@ -57,7 +57,7 @@ module ActionDispatch end def source_extract - if trace = application_trace.first + if application_trace && trace = application_trace.first file, line, _ = trace.split(":") @file = file @line_number = line.to_i @@ -92,6 +92,7 @@ module ActionDispatch end def source_fragment(path, line) + return unless Rails.respond_to?(:root) && Rails.root full_path = Rails.root.join(path) if File.exists?(full_path) File.open(full_path, "r") do |file| -- cgit v1.2.3