From e1056530665d5c8eed2c325157fbb88553eb2678 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 20 Feb 2007 22:09:12 +0000 Subject: Added .erb and .builder as preferred aliases to the now deprecated .rhtml and .rxml extensions [Chad Fowler]. This is done to separate the renderer from the mime type. .erb templates are often used to render emails, atom, csv, whatever. So labeling them .rhtml doesn't make too much sense. The same goes for .rxml, which can be used to build everything from HTML to Atom to whatever. .rhtml and .rxml will continue to work until Rails 3.0, though. So this is a slow phasing out. All generators and examples will start using the new aliases, though. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../templates/rescues/_request_and_response.rhtml | 44 ---------------------- .../templates/rescues/_trace.rhtml | 26 ------------- .../templates/rescues/diagnostics.rhtml | 11 ------ .../templates/rescues/layout.rhtml | 29 -------------- .../templates/rescues/missing_template.rhtml | 2 - .../templates/rescues/routing_error.rhtml | 10 ----- .../templates/rescues/template_error.rhtml | 21 ----------- .../templates/rescues/unknown_action.rhtml | 2 - 8 files changed, 145 deletions(-) (limited to 'actionpack/lib/action_controller/templates/rescues') diff --git a/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml b/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml index fe60bfdd40..e69de29bb2 100644 --- a/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml @@ -1,44 +0,0 @@ -<% unless @exception.blamed_files.blank? %> - <% if (hide = @exception.blamed_files.length > 8) %> - Show blamed files - <% end %> -
><%=h @exception.describe_blame %>
-<% end %> - -<% if false %> -

- <% begin %> - <%= form_tag(request.request_uri, "method" => request.method) %> - - - <% for key, values in params %> - <% next if key == "BP-RETRY" %> - <% for value in Array(values) %> - - <% end %> - <% end %> - - - - <% rescue Exception => e %> - <%=h "Couldn't render breakpoint link due to #{e.class} #{e.message}" %> - <% end %> -<% end %> - -<% - clean_params = request.parameters.clone - clean_params.delete("action") - clean_params.delete("controller") - - request_dump = clean_params.empty? ? 'None' : clean_params.inspect.gsub(',', ",\n") -%> - -

Request

-

Parameters:

<%=h request_dump %>

- -

Show session dump

- - - -

Response

-

Headers:

<%=h response ? response.headers.inspect.gsub(',', ",\n") : 'None' %>

diff --git a/actionpack/lib/action_controller/templates/rescues/_trace.rhtml b/actionpack/lib/action_controller/templates/rescues/_trace.rhtml index b322b0aaae..e69de29bb2 100644 --- a/actionpack/lib/action_controller/templates/rescues/_trace.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/_trace.rhtml @@ -1,26 +0,0 @@ -<% - traces = [ - ["Application Trace", @exception.application_backtrace], - ["Framework Trace", @exception.framework_backtrace], - ["Full Trace", @exception.clean_backtrace] - ] - names = traces.collect {|name, trace| name} -%> - -

RAILS_ROOT: <%= defined?(RAILS_ROOT) ? RAILS_ROOT : "unset" %>

- -
- <% 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.rhtml b/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml index e9faacef09..e69de29bb2 100644 --- a/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml @@ -1,11 +0,0 @@ -

- <%=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.rhtml", false) %> - -<%= render_file(@rescues_path + "/_request_and_response.rhtml", false) %> diff --git a/actionpack/lib/action_controller/templates/rescues/layout.rhtml b/actionpack/lib/action_controller/templates/rescues/layout.rhtml index d38f3e67f9..e69de29bb2 100644 --- a/actionpack/lib/action_controller/templates/rescues/layout.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/layout.rhtml @@ -1,29 +0,0 @@ - - - Action Controller: Exception caught - - - - -<%= @contents %> - - - \ No newline at end of file diff --git a/actionpack/lib/action_controller/templates/rescues/missing_template.rhtml b/actionpack/lib/action_controller/templates/rescues/missing_template.rhtml index dbfdf76947..e69de29bb2 100644 --- a/actionpack/lib/action_controller/templates/rescues/missing_template.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/missing_template.rhtml @@ -1,2 +0,0 @@ -

Template is missing

-

<%=h @exception.message %>

diff --git a/actionpack/lib/action_controller/templates/rescues/routing_error.rhtml b/actionpack/lib/action_controller/templates/rescues/routing_error.rhtml index ccfa858cce..e69de29bb2 100644 --- a/actionpack/lib/action_controller/templates/rescues/routing_error.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/routing_error.rhtml @@ -1,10 +0,0 @@ -

Routing Error

-

<%=h @exception.message %>

-<% unless @exception.failures.empty? %>

-

Failure reasons:

-
    - <% @exception.failures.each do |route, reason| %> -
  1. <%=h route.inspect.gsub('\\', '') %> failed because <%=h reason.downcase %>
  2. - <% end %> -
-

<% end %> diff --git a/actionpack/lib/action_controller/templates/rescues/template_error.rhtml b/actionpack/lib/action_controller/templates/rescues/template_error.rhtml index 827d66467d..e69de29bb2 100644 --- a/actionpack/lib/action_controller/templates/rescues/template_error.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/template_error.rhtml @@ -1,21 +0,0 @@ -

- <%=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 %>): -

<%=h @exception.source_extract %>

- -

<%=h @exception.sub_template_message %>

- -<% @real_exception = @exception - @exception = @exception.original_exception || @exception %> -<%= render_file(@rescues_path + "/_trace.rhtml", false) %> -<% @exception = @real_exception %> - -<%= render_file(@rescues_path + "/_request_and_response.rhtml", false) %> diff --git a/actionpack/lib/action_controller/templates/rescues/unknown_action.rhtml b/actionpack/lib/action_controller/templates/rescues/unknown_action.rhtml index 683379da10..e69de29bb2 100644 --- a/actionpack/lib/action_controller/templates/rescues/unknown_action.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/unknown_action.rhtml @@ -1,2 +0,0 @@ -

Unknown action

-

<%=h @exception.message %>

-- cgit v1.2.3