From 7d8ecad127c8e7b2ffcab883c71e16414a4261c2 Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Tue, 18 Oct 2005 14:08:05 +0000 Subject: Update error trace templates git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2677 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../templates/rescues/_trace.rhtml | 33 ++++++++++++---------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'actionpack/lib/action_controller/templates/rescues/_trace.rhtml') diff --git a/actionpack/lib/action_controller/templates/rescues/_trace.rhtml b/actionpack/lib/action_controller/templates/rescues/_trace.rhtml index 897320d767..8175fbf18e 100644 --- a/actionpack/lib/action_controller/templates/rescues/_trace.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/_trace.rhtml @@ -1,21 +1,24 @@ - -<% if @exception %> <% - clean_backtrace = @exception.clean_backtrace - app_trace = @exception.application_backtrace - framework_trace = clean_backtrace - app_trace - traces = {"Application Trace" => app_trace, "Framework Trace" => framework_trace, "Full Trace" => clean_backtrace} - trace_names = ["Application Trace", "Framework Trace", "Full Trace"] + traces = [ + ["Application Trace", @exception.application_backtrace], + ["Framework Trace", @exception.framework_backtrace], + ["Full Trace", @exception.clean_backtrace] + ] + names = traces.collect {|name, trace| name} %>
- <% trace_names.each do |k| -%> -
;"> - <% trace_names.each do |ok| -%> - <%= ok %> <%= '|' unless trace_names.last == ok %> - <% end -%> -
<%= traces[k].join "\n" %>
+ <% names.each do |name| -%> + <% + show = "document.getElementById('#{name.gsub /\s/, '-'}').style.display='block';" + hide = (names - [name]).collect {|hide_name| "document.getElementById('#{hide_name.gsub /\s/, '-'}').style.display='none';"} + %> + <%= name %> <%= '|' unless names.last == name %> + <% end -%> + + <% traces.each do |name, trace| -%> +
;"> +
<%= trace.join "\n" %>
<% end -%> -
-<% end %> \ No newline at end of file +
\ No newline at end of file -- cgit v1.2.3