Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added .erb and .builder as preferred aliases to the now deprecated .r…
…html 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
- Loading branch information
Showing
79 changed files
with
61 additions
and
515 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +0,0 @@ | ||
<h1>Address Book</h1> | ||
|
||
<% if @people.empty? %> | ||
<p>No people in the address book yet</p> | ||
<% else %> | ||
<table> | ||
<tr><th>Name</th><th>Email Address</th><th>Phone Number</th></tr> | ||
<% for person in @people %> | ||
<tr><td><%= person.name %></td><td><%= person.email_address %></td><td><%= person.phone_number %></td></tr> | ||
<% end %> | ||
</table> | ||
<% end %> | ||
|
||
<form action="create_person"> | ||
<p> | ||
Name:<br /> | ||
<input type="text" name="person[name]"> | ||
</p> | ||
|
||
<p> | ||
Email address:<br /> | ||
<input type="text" name="person[email_address]"> | ||
</p> | ||
|
||
<p> | ||
Phone number:<br /> | ||
<input type="text" name="person[phone_number]"> | ||
</p> | ||
|
||
<p> | ||
<input type="submit" value="Create Person"> | ||
</p> | ||
</form> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +0,0 @@ | ||
<html> | ||
<head> | ||
<title><%= @title || "Untitled" %></title> | ||
</head> | ||
<body> | ||
<%= @content_for_layout %> | ||
</body> | ||
</html> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +0,0 @@ | ||
<html> | ||
<body> | ||
<h1>Topics</h1> | ||
|
||
<%= link_to "New topic", :action => "new_topic" %> | ||
|
||
<ul> | ||
<% for topic in @topics %> | ||
<li><%= link_to "#{topic.title} (#{topic.replies.length} replies)", :action => "topic", :path_params => { "id" => topic.id } %></li> | ||
<% end %> | ||
</ul> | ||
|
||
</body> | ||
</html> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +0,0 @@ | ||
<html> | ||
<body> | ||
<h1>New topic</h1> | ||
|
||
<form action="<%= url_for(:action => "create_topic") %>" method="post"> | ||
<p> | ||
Title:<br> | ||
<input type="text" name="topic[title]"> | ||
</p> | ||
|
||
<p> | ||
Body:<br> | ||
<textarea name="topic[body]" style="width: 200px; height: 200px"></textarea> | ||
</p> | ||
|
||
<p> | ||
<input type="submit" value="Create topic"> | ||
</p> | ||
</form> | ||
|
||
</body> | ||
</html> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +0,0 @@ | ||
<html> | ||
<body> | ||
<h1><%= @topic.title %></h1> | ||
|
||
<p><%= @topic.body %></p> | ||
|
||
<%= link_to "Back to topics", :action => "index" %> | ||
<% unless @topic.replies.empty? %> | ||
<h2>Replies</h2> | ||
<ol> | ||
<% for reply in @topic.replies %> | ||
<li><%= reply.body %></li> | ||
<% end %> | ||
</ol> | ||
<% end %> | ||
|
||
<h2>Reply to this topic</h2> | ||
|
||
<form action="<%= url_for(:action => "create_reply") %>" method="post"> | ||
<input type="hidden" name="reply[topic_id]" value="<%= @topic.id %>"> | ||
<p> | ||
<textarea name="reply[body]" style="width: 200px; height: 200px"></textarea> | ||
</p> | ||
|
||
<p> | ||
<input type="submit" value="Create reply"> | ||
</p> | ||
</form> | ||
|
||
</body> | ||
</html> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
26 changes: 0 additions & 26 deletions
26
actionpack/lib/action_controller/templates/rescues/_trace.rhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
11 changes: 0 additions & 11 deletions
11
actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) %> | ||
29 changes: 0 additions & 29 deletions
29
actionpack/lib/action_controller/templates/rescues/layout.rhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
2 changes: 0 additions & 2 deletions
2
actionpack/lib/action_controller/templates/rescues/missing_template.rhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +0,0 @@ | ||
<h1>Template is missing</h1> | ||
<p><%=h @exception.message %></p> | ||
10 changes: 0 additions & 10 deletions
10
actionpack/lib/action_controller/templates/rescues/routing_error.rhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %> | ||
Oops, something went wrong.