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 --- .../templates/rescues/template_error.erb | 53 ++++++++++++++++------ 1 file changed, 40 insertions(+), 13 deletions(-) (limited to 'actionpack/lib/action_dispatch/middleware/templates') diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb index a1b377f68c..01faf5a475 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb @@ -1,17 +1,44 @@ -

- <%=h @exception.original_exception.class.to_s %> in - <%=h @request.parameters["controller"].capitalize if @request.parameters["controller"]%>#<%=h @request.parameters["action"] %> -

+<% @source_extract = @exception.source_extract(0, :html) %> +
+

+ <%=h @exception.original_exception.class.to_s %> in + <%=h @request.parameters["controller"].capitalize if @request.parameters["controller"]%>#<%=h @request.parameters["action"] %> +

+
-

- Showing <%=h @exception.file_name %> where line #<%=h @exception.line_number %> raised: -

<%=h @exception.message %>
-

+
+

+ Showing <%=h @exception.file_name %> where line #<%=h @exception.line_number %> raised: +

<%=h @exception.message %>
+

-

Extracted source (around line #<%=h @exception.line_number %>): -

<%=h @exception.source_extract %>

+
+
+

Extracted source (around line #<%=h @exception.line_number %>): +

+
+ + + + + +
+
+            <% @source_extract.keys.each do |line_number| %>
+<%= line_number -%>
+            <% end %>
+          
+
+
+<% @source_extract.each do |line, source| -%>
"><%= source -%>
<% end -%> +
+
+
+
-

<%=h @exception.sub_template_message %>

+

<%=h @exception.sub_template_message %>

-<%= render template: "rescues/_trace" %> -<%= render template: "rescues/_request_and_response" %> + <%= render template: "rescues/_trace" %> + <%= render template: "rescues/_request_and_response" %> +
+ -- cgit v1.2.3