aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/templates
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-02-20 22:09:12 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-02-20 22:09:12 +0000
commite1056530665d5c8eed2c325157fbb88553eb2678 (patch)
tree30341bae8b9a63faed289f9dc56c1a654a449731 /actionpack/lib/action_controller/templates
parent89cb34c9cfe9d169b79206b74c602e91bc7116a5 (diff)
downloadrails-e1056530665d5c8eed2c325157fbb88553eb2678.tar.gz
rails-e1056530665d5c8eed2c325157fbb88553eb2678.tar.bz2
rails-e1056530665d5c8eed2c325157fbb88553eb2678.zip
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
Diffstat (limited to 'actionpack/lib/action_controller/templates')
-rw-r--r--actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml44
-rw-r--r--actionpack/lib/action_controller/templates/rescues/_trace.rhtml26
-rw-r--r--actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml11
-rw-r--r--actionpack/lib/action_controller/templates/rescues/layout.rhtml29
-rw-r--r--actionpack/lib/action_controller/templates/rescues/missing_template.rhtml2
-rw-r--r--actionpack/lib/action_controller/templates/rescues/routing_error.rhtml10
-rw-r--r--actionpack/lib/action_controller/templates/rescues/template_error.rhtml21
-rw-r--r--actionpack/lib/action_controller/templates/rescues/unknown_action.rhtml2
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/edit.rhtml7
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/layout.rhtml69
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/list.rhtml27
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/new.rhtml6
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/show.rhtml9
13 files changed, 0 insertions, 263 deletions
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) %>
- <a href="#" onclick="document.getElementById('blame_trace').style.display='block'; return false;">Show blamed files</a>
- <% end %>
- <pre id="blame_trace" <%='style="display:none"' if hide %>><code><%=h @exception.describe_blame %></code></pre>
-<% end %>
-
-<% if false %>
- <br /><br />
- <% begin %>
- <%= form_tag(request.request_uri, "method" => request.method) %>
- <input type="hidden" name="BP-RETRY" value="1" />
-
- <% for key, values in params %>
- <% next if key == "BP-RETRY" %>
- <% for value in Array(values) %>
- <input type="hidden" name="<%= key %>" value="<%= value %>" />
- <% end %>
- <% end %>
-
- <input type="submit" value="Retry with Breakpoint" />
- </form>
- <% 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")
-%>
-
-<h2 style="margin-top: 30px">Request</h2>
-<p><b>Parameters</b>: <pre><%=h request_dump %></pre></p>
-
-<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
-<div id="session_dump" style="display:none"><%= debug(request.session.instance_variable_get("@data")) %></div>
-
-
-<h2 style="margin-top: 30px">Response</h2>
-<p><b>Headers</b>: <pre><%=h response ? response.headers.inspect.gsub(',', ",\n") : 'None' %></pre></p>
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}
-%>
-
-<p><code>RAILS_ROOT: <%= defined?(RAILS_ROOT) ? RAILS_ROOT : "unset" %></code></p>
-
-<div id="traces">
- <% 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';"}
- %>
- <a href="#" onclick="<%= hide %><%= show %>; return false;"><%= name %></a> <%= '|' unless names.last == name %>
- <% end -%>
-
- <% traces.each do |name, trace| -%>
- <div id="<%= name.gsub /\s/, '-' %>" style="display: <%= name == "Application Trace" ? 'block' : 'none' %>;">
- <pre><code><%= trace.join "\n" %></code></pre>
- </div>
- <% end -%>
-</div> \ 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 @@
-<h1>
- <%=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 %>
-</h1>
-<pre><%=h @exception.clean_message %></pre>
-
-<%= 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 @@
-<html>
-<head>
- <title>Action Controller: Exception caught</title>
- <style>
- body { background-color: #fff; color: #333; }
-
- body, p, ol, ul, td {
- font-family: verdana, arial, helvetica, sans-serif;
- font-size: 13px;
- line-height: 18px;
- }
-
- pre {
- background-color: #eee;
- padding: 10px;
- font-size: 11px;
- }
-
- a { color: #000; }
- a:visited { color: #666; }
- a:hover { color: #fff; background-color:#000; }
- </style>
-</head>
-<body>
-
-<%= @contents %>
-
-</body>
-</html> \ 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 @@
-<h1>Template is missing</h1>
-<p><%=h @exception.message %></p>
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 @@
-<h1>Routing Error</h1>
-<p><pre><%=h @exception.message %></pre></p>
-<% unless @exception.failures.empty? %><p>
- <h2>Failure reasons:</h2>
- <ol>
- <% @exception.failures.each do |route, reason| %>
- <li><code><%=h route.inspect.gsub('\\', '') %></code> failed because <%=h reason.downcase %></li>
- <% end %>
- </ol>
-</p><% 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 @@
-<h1>
- <%=h @exception.original_exception.class.to_s %> in
- <%=h request.parameters["controller"].capitalize if request.parameters["controller"]%>#<%=h request.parameters["action"] %>
-</h1>
-
-<p>
- Showing <i><%=h @exception.file_name %></i> where line <b>#<%=h @exception.line_number %></b> raised:
- <pre><code><%=h @exception.message %></code></pre>
-</p>
-
-<p>Extracted source (around line <b>#<%=h @exception.line_number %></b>):
-<pre><code><%=h @exception.source_extract %></code></pre></p>
-
-<p><%=h @exception.sub_template_message %></p>
-
-<% @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 @@
-<h1>Unknown action</h1>
-<p><%=h @exception.message %></p>
diff --git a/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml b/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml
index 63dff602a1..e69de29bb2 100644
--- a/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml
+++ b/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml
@@ -1,7 +0,0 @@
-<h1>Editing <%= @scaffold_singular_name %></h1>
-
-<%= error_messages_for(@scaffold_singular_name) %>
-<%= form(@scaffold_singular_name, :action => "update#{@scaffold_suffix}") %>
-
-<%= link_to "Show", :action => "show#{@scaffold_suffix}", :id => instance_variable_get("@#{@scaffold_singular_name}") %> |
-<%= link_to "Back", :action => "list#{@scaffold_suffix}" %>
diff --git a/actionpack/lib/action_controller/templates/scaffolds/layout.rhtml b/actionpack/lib/action_controller/templates/scaffolds/layout.rhtml
index 759781e0e7..e69de29bb2 100644
--- a/actionpack/lib/action_controller/templates/scaffolds/layout.rhtml
+++ b/actionpack/lib/action_controller/templates/scaffolds/layout.rhtml
@@ -1,69 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <title>Scaffolding</title>
- <style>
- body { background-color: #fff; color: #333; }
-
- body, p, ol, ul, td {
- font-family: verdana, arial, helvetica, sans-serif;
- font-size: 13px;
- line-height: 18px;
- }
-
- pre {
- background-color: #eee;
- padding: 10px;
- font-size: 11px;
- }
-
- a { color: #000; }
- a:visited { color: #666; }
- a:hover { color: #fff; background-color:#000; }
-
- .fieldWithErrors {
- padding: 2px;
- background-color: red;
- display: table;
- }
-
- #errorExplanation {
- width: 400px;
- border: 2px solid red;
- padding: 7px;
- padding-bottom: 12px;
- margin-bottom: 20px;
- background-color: #f0f0f0;
- }
-
- #errorExplanation h2 {
- text-align: left;
- font-weight: bold;
- padding: 5px 5px 5px 15px;
- font-size: 12px;
- margin: -7px;
- background-color: #c00;
- color: #fff;
- }
-
- #errorExplanation p {
- color: #333;
- margin-bottom: 0;
- padding: 5px;
- }
-
- #errorExplanation ul li {
- font-size: 12px;
- list-style: square;
- }
- </style>
-</head>
-<body>
-
-<p style="color: green"><%= flash[:notice] %></p>
-
-<%= yield %>
-
-</body>
-</html>
diff --git a/actionpack/lib/action_controller/templates/scaffolds/list.rhtml b/actionpack/lib/action_controller/templates/scaffolds/list.rhtml
index fea23dc66f..e69de29bb2 100644
--- a/actionpack/lib/action_controller/templates/scaffolds/list.rhtml
+++ b/actionpack/lib/action_controller/templates/scaffolds/list.rhtml
@@ -1,27 +0,0 @@
-<h1>Listing <%= @scaffold_plural_name %></h1>
-
-<table>
- <tr>
- <% for column in @scaffold_class.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- </tr>
-
-<% for entry in instance_variable_get("@#{@scaffold_plural_name}") %>
- <tr>
- <% for column in @scaffold_class.content_columns %>
- <td><%= entry.send(column.name) %></td>
- <% end %>
- <td><%= link_to "Show", :action => "show#{@scaffold_suffix}", :id => entry %></td>
- <td><%= link_to "Edit", :action => "edit#{@scaffold_suffix}", :id => entry %></td>
- <td><%= link_to "Destroy", {:action => "destroy#{@scaffold_suffix}", :id => entry}, { :confirm => "Are you sure?", :method => :post } %></td>
- </tr>
-<% end %>
-</table>
-
-<%= link_to "Previous page", { :page => instance_variable_get("@#{@scaffold_singular_name}_pages").current.previous } if instance_variable_get("@#{@scaffold_singular_name}_pages").current.previous %>
-<%= link_to "Next page", { :page => instance_variable_get("@#{@scaffold_singular_name}_pages").current.next } if instance_variable_get("@#{@scaffold_singular_name}_pages").current.next %>
-
-<br />
-
-<%= link_to "New #{@scaffold_singular_name}", :action => "new#{@scaffold_suffix}" %>
diff --git a/actionpack/lib/action_controller/templates/scaffolds/new.rhtml b/actionpack/lib/action_controller/templates/scaffolds/new.rhtml
index 66f6626f4e..e69de29bb2 100644
--- a/actionpack/lib/action_controller/templates/scaffolds/new.rhtml
+++ b/actionpack/lib/action_controller/templates/scaffolds/new.rhtml
@@ -1,6 +0,0 @@
-<h1>New <%= @scaffold_singular_name %></h1>
-
-<%= error_messages_for(@scaffold_singular_name) %>
-<%= form(@scaffold_singular_name, :action => "create#{@scaffold_suffix}") %>
-
-<%= link_to "Back", :action => "list#{@scaffold_suffix}" %>
diff --git a/actionpack/lib/action_controller/templates/scaffolds/show.rhtml b/actionpack/lib/action_controller/templates/scaffolds/show.rhtml
index 46cdfdb493..e69de29bb2 100644
--- a/actionpack/lib/action_controller/templates/scaffolds/show.rhtml
+++ b/actionpack/lib/action_controller/templates/scaffolds/show.rhtml
@@ -1,9 +0,0 @@
-<% for column in @scaffold_class.content_columns %>
- <p>
- <b><%= column.human_name %>:</b>
- <%= instance_variable_get("@#{@scaffold_singular_name}").send(column.name) %>
- </p>
-<% end %>
-
-<%= link_to "Edit", :action => "edit#{@scaffold_suffix}", :id => instance_variable_get("@#{@scaffold_singular_name}") %> |
-<%= link_to "Back", :action => "list#{@scaffold_suffix}" %>