diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-09-28 16:20:48 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-09-28 16:20:48 -0300 |
commit | 6286b63f27b6b36b9603c4c68600f8f352b84137 (patch) | |
tree | ddc9573f1a5f0d865b945857d1bc35d76a65ecee /actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb | |
parent | 540e87256df08d350e9eb572408e5f68fa59f42b (diff) | |
download | rails-6286b63f27b6b36b9603c4c68600f8f352b84137.tar.gz rails-6286b63f27b6b36b9603c4c68600f8f352b84137.tar.bz2 rails-6286b63f27b6b36b9603c4c68600f8f352b84137.zip |
Remove warings from rescues: don't define more than once debug_hash method and ask if @response if defined.
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb index e963b04524..97f7cf0bbe 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb @@ -14,7 +14,7 @@ def debug_hash(hash) hash.sort_by { |k, v| k.to_s }.map { |k, v| "#{k}: #{v.inspect rescue $!.message}" }.join("\n") - end + end unless self.class.method_defined?(:debug_hash) %> <h2 style="margin-top: 30px">Request</h2> @@ -28,4 +28,4 @@ <h2 style="margin-top: 30px">Response</h2> -<p><b>Headers</b>: <pre><%=h @response ? @response.headers.inspect.gsub(',', ",\n") : 'None' %></pre></p> +<p><b>Headers</b>: <pre><%=h defined?(@response) ? @response.headers.inspect.gsub(',', ",\n") : 'None' %></pre></p> |