From 048cd254e6bb77cf223a714cd7cb86b309cd3c15 Mon Sep 17 00:00:00 2001
From: Guillermo Iguaran
Date: Fri, 7 Sep 2012 20:20:09 -0500
Subject: Styling for exception page
---
.../templates/rescues/_request_and_response.erb | 15 ++--
.../middleware/templates/rescues/_source.erb | 25 +++++-
.../middleware/templates/rescues/diagnostics.erb | 25 +++---
.../middleware/templates/rescues/layout.erb | 97 ++++++++++++++++++++--
.../templates/rescues/missing_template.erb | 9 +-
.../templates/rescues/unknown_action.erb | 8 +-
6 files changed, 150 insertions(+), 29 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 823f5d25b6..9688bf6a57 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
@@ -20,12 +20,15 @@
Request
Parameters:
<%=h request_dump %>
-Show session dump
-<%= debug_hash @request.session %>
-
-Show env dump
-<%= debug_hash @request.env.slice(*@request.class::ENV_METHODS) %>
-
+
+Show session dump
+<%= debug_hash @request.session %>
+
+
+
+Show env dump
+<%= debug_hash @request.env.slice(*@request.class::ENV_METHODS) %>
+
Response
Headers:
<%=h defined?(@response) ? @response.headers.inspect.gsub(',', ",\n") : 'None' %>
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb
index 032705c01a..38429cb78e 100644
--- a/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb
+++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb
@@ -1,8 +1,25 @@
<% if @source_extract %>
-Extracted source (around line #<%= @line_number %>):
+
+
+ Extracted source (around line #<%= @line_number %>):
+
+
+
+
+
+
+ <% @source_extract.keys.each do |line_number| %>
+<%= line_number -%>
+ <% end %>
+
+ |
+
-<% @source_extract.each do |line, source| %>
-<%= "#{(@line_number == line) ? "> " : " "}#{line}: #{source}" -%>
-<% end %>
+<% @source_extract.each do |line, source| -%>"><%= source -%> <% end -%>
+ |
+
+
+
+
<% end %>
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb
index 5ad96cc657..1c6b5010a3 100644
--- a/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb
+++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb
@@ -1,11 +1,16 @@
-
- <%=h @exception.class.to_s %>
- <% if @request.parameters['controller'] %>
- in <%=h @request.parameters['controller'].camelize %>Controller<% if @request.parameters['action'] %>#<%=h @request.parameters['action'] %><% end %>
- <% end %>
-
-<%=h @exception.message %>
+
+
+ <%=h @exception.class.to_s %>
+ <% if @request.parameters['controller'] %>
+ in <%=h @request.parameters['controller'].camelize %>Controller<% if @request.parameters['action'] %>#<%=h @request.parameters['action'] %><% end %>
+ <% end %>
+
+
-<%= render template: "rescues/_source" %>
-<%= render template: "rescues/_trace" %>
-<%= render template: "rescues/_request_and_response" %>
+
+
<%=h @exception.message %>
+
+ <%= render template: "rescues/_source" %>
+ <%= render template: "rescues/_trace" %>
+ <%= render template: "rescues/_request_and_response" %>
+
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb
index 1a308707d1..0aba130f05 100644
--- a/actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb
+++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb
@@ -4,7 +4,7 @@
Action Controller: Exception caught
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.erb
index dbfdf76947..c5917b9acb 100644
--- a/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.erb
+++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.erb
@@ -1,2 +1,7 @@
-Template is missing
-<%=h @exception.message %>
+
+
+
+
<%=h @exception.message %>
+
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb
index 683379da10..65fc34df90 100644
--- a/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb
+++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb
@@ -1,2 +1,6 @@
-Unknown action
-<%=h @exception.message %>
+
+
+
<%=h @exception.message %>
+
--
cgit v1.2.3