+ <% 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 -%>
+
\ No newline at end of file
diff --git a/actionpack/lib/action_controller/templates/rescues/diagnostics.erb b/actionpack/lib/action_controller/templates/rescues/diagnostics.erb
new file mode 100644
index 0000000000..032f945ed2
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/rescues/diagnostics.erb
@@ -0,0 +1,11 @@
+
+ <%=h @exception.class.to_s %>
+ <% if request.parameters['controller'] %>
+ in <%=h request.parameters['controller'].humanize %>Controller<% if request.parameters['action'] %>#<%=h request.parameters['action'] %><% end %>
+ <% end %>
+
+
<%=h @exception.clean_message %>
+
+<%= render_file(@rescues_path + "/_trace.erb", false) %>
+
+<%= render_file(@rescues_path + "/_request_and_response.erb", false) %>
diff --git a/actionpack/lib/action_controller/templates/rescues/layout.erb b/actionpack/lib/action_controller/templates/rescues/layout.erb
new file mode 100644
index 0000000000..d38f3e67f9
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/rescues/layout.erb
@@ -0,0 +1,29 @@
+
+
+ Action Controller: Exception caught
+
+
+
+
+<%= @contents %>
+
+
+
\ No newline at end of file
diff --git a/actionpack/lib/action_controller/templates/rescues/missing_template.erb b/actionpack/lib/action_controller/templates/rescues/missing_template.erb
new file mode 100644
index 0000000000..dbfdf76947
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/rescues/missing_template.erb
@@ -0,0 +1,2 @@
+
Template is missing
+
<%=h @exception.message %>
diff --git a/actionpack/lib/action_controller/templates/rescues/routing_error.erb b/actionpack/lib/action_controller/templates/rescues/routing_error.erb
new file mode 100644
index 0000000000..ccfa858cce
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/rescues/routing_error.erb
@@ -0,0 +1,10 @@
+
Routing Error
+
<%=h @exception.message %>
+<% unless @exception.failures.empty? %>
+
Failure reasons:
+
+ <% @exception.failures.each do |route, reason| %>
+
<%=h route.inspect.gsub('\\', '') %> failed because <%=h reason.downcase %>
+ <% end %>
+
+<% end %>
diff --git a/actionpack/lib/action_controller/templates/rescues/template_error.erb b/actionpack/lib/action_controller/templates/rescues/template_error.erb
new file mode 100644
index 0000000000..eda64db3e9
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/rescues/template_error.erb
@@ -0,0 +1,21 @@
+
+ <%=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 %>
+
+
+
Extracted source (around line #<%=h @exception.line_number %>):
+