mirror of
https://github.com/github/rails.git
synced 2026-01-10 07:07:54 -05:00
Apply the rest of Chads patch
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -52,9 +52,9 @@ module ActionMailer #:nodoc:
|
||||
#
|
||||
# Like ActionController, each mailer class has a corresponding view directory
|
||||
# in which each method of the class looks for a template with its name.
|
||||
# To define a template to be used with a mailing, create an <tt>.rhtml</tt> file with the same name as the method
|
||||
# To define a template to be used with a mailing, create an <tt>.erb</tt> file with the same name as the method
|
||||
# in your mailer model. For example, in the mailer defined above, the template at
|
||||
# <tt>app/views/notifier/signup_notification.rhtml</tt> would be used to generate the email.
|
||||
# <tt>app/views/notifier/signup_notification.erb</tt> would be used to generate the email.
|
||||
#
|
||||
# Variables defined in the model are accessible as instance variables in the view.
|
||||
#
|
||||
@@ -103,7 +103,7 @@ module ActionMailer #:nodoc:
|
||||
#
|
||||
# = HTML email
|
||||
#
|
||||
# To send mail as HTML, make sure your view (the <tt>.rhtml</tt> file) generates HTML and
|
||||
# To send mail as HTML, make sure your view (the <tt>.erb</tt> file) generates HTML and
|
||||
# set the content type to html.
|
||||
#
|
||||
# class MyMailer < ActionMailer::Base
|
||||
@@ -142,10 +142,10 @@ module ActionMailer #:nodoc:
|
||||
# by the content type. Each such detected template will be added as separate part to the message.
|
||||
#
|
||||
# For example, if the following templates existed:
|
||||
# * signup_notification.text.plain.rhtml
|
||||
# * signup_notification.text.html.rhtml
|
||||
# * signup_notification.text.xml.rxml
|
||||
# * signup_notification.text.x-yaml.rhtml
|
||||
# * signup_notification.text.plain.erb
|
||||
# * signup_notification.text.html.erb
|
||||
# * signup_notification.text.xml.builder
|
||||
# * signup_notification.text.x-yaml.erb
|
||||
#
|
||||
# Each would be rendered and added as a separate part to the message,
|
||||
# with the corresponding content type. The same body hash is passed to
|
||||
@@ -383,14 +383,14 @@ module ActionMailer #:nodoc:
|
||||
unless String === @body
|
||||
# First, we look to see if there are any likely templates that match,
|
||||
# which include the content-type in their file name (i.e.,
|
||||
# "the_template_file.text.html.rhtml", etc.). Only do this if parts
|
||||
# "the_template_file.text.html.erb", etc.). Only do this if parts
|
||||
# have not already been specified manually.
|
||||
if @parts.empty?
|
||||
templates = Dir.glob("#{template_path}/#{@template}.*")
|
||||
templates.each do |path|
|
||||
# TODO: don't hardcode rhtml|rxml
|
||||
# TODO: don't hardcode erb|builder
|
||||
basename = File.basename(path)
|
||||
next unless md = /^([^\.]+)\.([^\.]+\.[^\.]+)\.(rhtml|rxml)$/.match(basename)
|
||||
next unless md = /^([^\.]+)\.([^\.]+\.[^\.]+)\.(erb|builder|rhtml|rxml)$/.match(basename)
|
||||
template_name = basename
|
||||
content_type = md.captures[1].gsub('.', '/')
|
||||
@parts << Part.new(:content_type => content_type,
|
||||
|
||||
1
actionmailer/test/fixtures/first_mailer/share.erb
vendored
Normal file
1
actionmailer/test/fixtures/first_mailer/share.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
first mail
|
||||
@@ -1 +0,0 @@
|
||||
first mail
|
||||
|
||||
1
actionmailer/test/fixtures/helper_mailer/use_example_helper.erb
vendored
Normal file
1
actionmailer/test/fixtures/helper_mailer/use_example_helper.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
So, <%= example_format(@text) %>
|
||||
@@ -1 +0,0 @@
|
||||
So, <%= example_format(@text) %>
|
||||
|
||||
1
actionmailer/test/fixtures/helper_mailer/use_helper.erb
vendored
Normal file
1
actionmailer/test/fixtures/helper_mailer/use_helper.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Hello, <%= person_name %>. Thanks for registering!
|
||||
@@ -1 +0,0 @@
|
||||
Hello, <%= person_name %>. Thanks for registering!
|
||||
|
||||
1
actionmailer/test/fixtures/helper_mailer/use_helper_method.erb
vendored
Normal file
1
actionmailer/test/fixtures/helper_mailer/use_helper_method.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
This message brought to you by <%= name_of_the_mailer_class %>.
|
||||
@@ -1 +0,0 @@
|
||||
This message brought to you by <%= name_of_the_mailer_class %>.
|
||||
|
||||
5
actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb
vendored
Normal file
5
actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
From "Romeo and Juliet":
|
||||
|
||||
<%= block_format @text %>
|
||||
|
||||
Good ol' Shakespeare.
|
||||
@@ -1,5 +0,0 @@
|
||||
From "Romeo and Juliet":
|
||||
|
||||
<%= block_format @text %>
|
||||
|
||||
Good ol' Shakespeare.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Have a lovely picture, from me. Enjoy!
|
||||
@@ -1 +0,0 @@
|
||||
Have a lovely picture, from me. Enjoy!
|
||||
1
actionmailer/test/fixtures/second_mailer/share.erb
vendored
Normal file
1
actionmailer/test/fixtures/second_mailer/share.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
second mail
|
||||
@@ -1 +0,0 @@
|
||||
second mail
|
||||
|
||||
3
actionmailer/test/fixtures/templates/signed_up.erb
vendored
Normal file
3
actionmailer/test/fixtures/templates/signed_up.erb
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Hello there,
|
||||
|
||||
Mr. <%= @recipient %>
|
||||
@@ -1,3 +0,0 @@
|
||||
Hello there,
|
||||
|
||||
Mr. <%= @recipient %>
|
||||
1
actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb
vendored
Normal file
1
actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Ignored when searching for implicitly multipart parts.
|
||||
@@ -1 +0,0 @@
|
||||
Ignored when searching for implicitly multipart parts.
|
||||
|
||||
10
actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb
vendored
Normal file
10
actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<body>
|
||||
HTML formatted message to <strong><%= @recipient %></strong>.
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<body>
|
||||
HTML formatted message to <strong><%= @recipient %></strong>.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
HTML formatted message to <strong><%= @recipient %></strong>.
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<body>
|
||||
HTML formatted message to <strong><%= @recipient %></strong>.
|
||||
</body>
|
||||
</html>
|
||||
|
||||
2
actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb
vendored
Normal file
2
actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
Plain text to <%= @recipient %>.
|
||||
Plain text to <%= @recipient %>.
|
||||
@@ -1,2 +0,0 @@
|
||||
Plain text to <%= @recipient %>.
|
||||
Plain text to <%= @recipient %>.
|
||||
|
||||
1
actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb
vendored
Normal file
1
actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
yaml to: <%= @recipient %>
|
||||
@@ -1 +0,0 @@
|
||||
yaml to: <%= @recipient %>
|
||||
3
actionmailer/test/fixtures/test_mailer/signed_up.erb
vendored
Normal file
3
actionmailer/test/fixtures/test_mailer/signed_up.erb
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Hello there,
|
||||
|
||||
Mr. <%= @recipient %>
|
||||
@@ -1,3 +0,0 @@
|
||||
Hello there,
|
||||
|
||||
Mr. <%= @recipient %>
|
||||
3
actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb
vendored
Normal file
3
actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Hello there,
|
||||
|
||||
Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %>
|
||||
@@ -1,3 +0,0 @@
|
||||
Hello there,
|
||||
|
||||
Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %>
|
||||
33
actionpack/examples/address_book/index.erb
Normal file
33
actionpack/examples/address_book/index.erb
Normal file
@@ -0,0 +1,33 @@
|
||||
<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>
|
||||
8
actionpack/examples/address_book/layout.erb
Normal file
8
actionpack/examples/address_book/layout.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title><%= @title || "Untitled" %></title>
|
||||
</head>
|
||||
<body>
|
||||
<%= @content_for_layout %>
|
||||
</body>
|
||||
</html>
|
||||
14
actionpack/examples/debate/index.erb
Normal file
14
actionpack/examples/debate/index.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<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>
|
||||
22
actionpack/examples/debate/new_topic.erb
Normal file
22
actionpack/examples/debate/new_topic.erb
Normal file
@@ -0,0 +1,22 @@
|
||||
<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>
|
||||
32
actionpack/examples/debate/topic.erb
Normal file
32
actionpack/examples/debate/topic.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<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>
|
||||
@@ -0,0 +1,44 @@
|
||||
<% 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>
|
||||
@@ -0,0 +1,26 @@
|
||||
<%
|
||||
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>
|
||||
@@ -0,0 +1,11 @@
|
||||
<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.erb", false) %>
|
||||
|
||||
<%= render_file(@rescues_path + "/_request_and_response.erb", false) %>
|
||||
@@ -0,0 +1,29 @@
|
||||
<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>
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1>Template is missing</h1>
|
||||
<p><%=h @exception.message %></p>
|
||||
@@ -0,0 +1,10 @@
|
||||
<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 %>
|
||||
@@ -0,0 +1,21 @@
|
||||
<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.erb", false) %>
|
||||
<% @exception = @real_exception %>
|
||||
|
||||
<%= render_file(@rescues_path + "/_request_and_response.erb", false) %>
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1>Unknown action</h1>
|
||||
<p><%=h @exception.message %></p>
|
||||
@@ -0,0 +1,7 @@
|
||||
<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}" %>
|
||||
@@ -0,0 +1,69 @@
|
||||
<!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>
|
||||
@@ -0,0 +1,27 @@
|
||||
<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}" %>
|
||||
@@ -0,0 +1,6 @@
|
||||
<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}" %>
|
||||
@@ -0,0 +1,9 @@
|
||||
<% 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}" %>
|
||||
1
actionpack/test/fixtures/addresses/list.erb
vendored
Normal file
1
actionpack/test/fixtures/addresses/list.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
We only need to get this far!
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= @cookies[:test] %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= cookies[:test] %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= @flash[:test] %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_flash_method.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_flash_method.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= flash[:test] %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= @headers[:test] %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_headers_method.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_headers_method.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= headers[:test] %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= @params[:test] %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_params_method.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_params_method.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= params[:test] %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= @request.method %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_request_method.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_request_method.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= request.method %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= @response.body %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_response_method.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_response_method.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= response.body %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= @session[:test] %>
|
||||
1
actionpack/test/fixtures/deprecated_instance_variables/_session_method.erb
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_session_method.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= session[:test] %>
|
||||
1
actionpack/test/fixtures/fun/games/hello_world.erb
vendored
Normal file
1
actionpack/test/fixtures/fun/games/hello_world.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Living in a nested world
|
||||
3
actionpack/test/fixtures/layouts/builder.builder
vendored
Normal file
3
actionpack/test/fixtures/layouts/builder.builder
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
xml.wrapper do
|
||||
xml << @content_for_layout
|
||||
end
|
||||
1
actionpack/test/fixtures/layouts/standard.erb
vendored
Normal file
1
actionpack/test/fixtures/layouts/standard.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<html><%= @content_for_layout %><%= @variable_for_layout %></html>
|
||||
2
actionpack/test/fixtures/layouts/talk_from_action.erb
vendored
Normal file
2
actionpack/test/fixtures/layouts/talk_from_action.erb
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
<title><%= @title || @content_for_title %></title>
|
||||
<%= @content_for_layout -%>
|
||||
2
actionpack/test/fixtures/layouts/yield.erb
vendored
Normal file
2
actionpack/test/fixtures/layouts/yield.erb
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
<title><%= yield :title %></title>
|
||||
<%= yield %>
|
||||
1
actionpack/test/fixtures/override/test/hello_world.erb
vendored
Normal file
1
actionpack/test/fixtures/override/test/hello_world.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Hello overridden world!
|
||||
1
actionpack/test/fixtures/scope/test/modgreet.erb
vendored
Normal file
1
actionpack/test/fixtures/scope/test/modgreet.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<p>Beautiful modules!</p>
|
||||
1
actionpack/test/fixtures/test/_customer.erb
vendored
Normal file
1
actionpack/test/fixtures/test/_customer.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Hello: <%= customer.name %>
|
||||
1
actionpack/test/fixtures/test/_customer_greeting.erb
vendored
Normal file
1
actionpack/test/fixtures/test/_customer_greeting.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= greeting %>: <%= customer_greeting.name %>
|
||||
1
actionpack/test/fixtures/test/_hash_object.erb
vendored
Normal file
1
actionpack/test/fixtures/test/_hash_object.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= hash_object[:first_name] %>
|
||||
1
actionpack/test/fixtures/test/_hello.builder
vendored
Normal file
1
actionpack/test/fixtures/test/_hello.builder
vendored
Normal file
@@ -0,0 +1 @@
|
||||
xm.hello
|
||||
1
actionpack/test/fixtures/test/_partial_only.erb
vendored
Normal file
1
actionpack/test/fixtures/test/_partial_only.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
only partial
|
||||
2
actionpack/test/fixtures/test/_person.erb
vendored
Normal file
2
actionpack/test/fixtures/test/_person.erb
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
Second: <%= name %>
|
||||
Third: <%= @name %>
|
||||
2
actionpack/test/fixtures/test/action_talk_to_layout.erb
vendored
Normal file
2
actionpack/test/fixtures/test/action_talk_to_layout.erb
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
<% @title = "Talking to the layout" -%>
|
||||
Action was here!
|
||||
2
actionpack/test/fixtures/test/block_content_for.erb
vendored
Normal file
2
actionpack/test/fixtures/test/block_content_for.erb
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
<% block_content_for :title do 'Putting stuff in the title!' end %>
|
||||
Great stuff!
|
||||
4
actionpack/test/fixtures/test/capturing.erb
vendored
Normal file
4
actionpack/test/fixtures/test/capturing.erb
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<% days = capture do %>
|
||||
Dreamy days
|
||||
<% end %>
|
||||
<%= days %>
|
||||
2
actionpack/test/fixtures/test/content_for.erb
vendored
Normal file
2
actionpack/test/fixtures/test/content_for.erb
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
<% content_for :title do %>Putting stuff in the title!<% end %>
|
||||
Great stuff!
|
||||
1
actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb
vendored
Normal file
1
actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
The secret is <%= @secret %>
|
||||
2
actionpack/test/fixtures/test/erb_content_for.erb
vendored
Normal file
2
actionpack/test/fixtures/test/erb_content_for.erb
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
<% erb_content_for :title do %>Putting stuff in the title!<% end %>
|
||||
Great stuff!
|
||||
1
actionpack/test/fixtures/test/greeting.erb
vendored
Normal file
1
actionpack/test/fixtures/test/greeting.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<p>This is grand!</p>
|
||||
4
actionpack/test/fixtures/test/hello.builder
vendored
Normal file
4
actionpack/test/fixtures/test/hello.builder
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
xml.html do
|
||||
xml.p "Hello #{@name}"
|
||||
xml << render_file("test/greeting")
|
||||
end
|
||||
3
actionpack/test/fixtures/test/hello_world.builder
vendored
Normal file
3
actionpack/test/fixtures/test/hello_world.builder
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
xml.html do
|
||||
xml.p "Hello"
|
||||
end
|
||||
1
actionpack/test/fixtures/test/hello_world.erb
vendored
Normal file
1
actionpack/test/fixtures/test/hello_world.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Hello world!
|
||||
3
actionpack/test/fixtures/test/hello_world_container.builder
vendored
Normal file
3
actionpack/test/fixtures/test/hello_world_container.builder
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
xml.test do
|
||||
render :partial => 'hello', :locals => { :xm => xml }
|
||||
end
|
||||
1
actionpack/test/fixtures/test/hello_world_with_layout_false.erb
vendored
Normal file
1
actionpack/test/fixtures/test/hello_world_with_layout_false.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Hello world!
|
||||
11
actionpack/test/fixtures/test/hello_xml_world.builder
vendored
Normal file
11
actionpack/test/fixtures/test/hello_xml_world.builder
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
xml.html do
|
||||
xml.head do
|
||||
xml.title "Hello World"
|
||||
end
|
||||
|
||||
xml.body do
|
||||
xml.p "abes"
|
||||
xml.p "monks"
|
||||
xml.p "wiseguys"
|
||||
end
|
||||
end
|
||||
1
actionpack/test/fixtures/test/list.erb
vendored
Normal file
1
actionpack/test/fixtures/test/list.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<%= @test_unchanged = 'goodbye' %><%= render_collection_of_partials "customer", @customers %><%= @test_unchanged %>
|
||||
4
actionpack/test/fixtures/test/non_erb_block_content_for.builder
vendored
Normal file
4
actionpack/test/fixtures/test/non_erb_block_content_for.builder
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
content_for :title do
|
||||
'Putting stuff in the title!'
|
||||
end
|
||||
xml << "\nGreat stuff!"
|
||||
4
actionpack/test/fixtures/test/potential_conflicts.erb
vendored
Normal file
4
actionpack/test/fixtures/test/potential_conflicts.erb
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
First: <%= @name %>
|
||||
<%= render :partial => "person", :locals => { :name => "Stephan" } -%>
|
||||
Fourth: <%= @name %>
|
||||
Fifth: <%= name %>
|
||||
1
actionpack/test/fixtures/test/render_file_with_ivar.erb
vendored
Normal file
1
actionpack/test/fixtures/test/render_file_with_ivar.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
The secret is <%= @secret %>
|
||||
1
actionpack/test/fixtures/test/render_file_with_locals.erb
vendored
Normal file
1
actionpack/test/fixtures/test/render_file_with_locals.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
The secret is <%= secret %>
|
||||
1
actionpack/test/fixtures/test/render_to_string_test.erb
vendored
Normal file
1
actionpack/test/fixtures/test/render_to_string_test.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
The value of foo is: ::<%= @foo %>::
|
||||
9
actionpack/test/fixtures/test/update_element_with_capture.erb
vendored
Normal file
9
actionpack/test/fixtures/test/update_element_with_capture.erb
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<% replacement_function = update_element_function("products", :action => :update) do %>
|
||||
<p>Product 1</p>
|
||||
<p>Product 2</p>
|
||||
<% end %>
|
||||
<%= javascript_tag(replacement_function) %>
|
||||
|
||||
<% update_element_function("status", :action => :update, :binding => binding) do %>
|
||||
<b>You bought something!</b>
|
||||
<% end %>
|
||||
@@ -25,10 +25,10 @@ module ActionWebService
|
||||
#
|
||||
# If you want to customize the default views, create the following views in "app/views":
|
||||
#
|
||||
# * <tt>action_name/methods.rhtml</tt>
|
||||
# * <tt>action_name/parameters.rhtml</tt>
|
||||
# * <tt>action_name/result.rhtml</tt>
|
||||
# * <tt>action_name/layout.rhtml</tt>
|
||||
# * <tt>action_name/methods.erb</tt>
|
||||
# * <tt>action_name/parameters.erb</tt>
|
||||
# * <tt>action_name/result.erb</tt>
|
||||
# * <tt>action_name/layout.erb</tt>
|
||||
#
|
||||
# Where <tt>action_name</tt> is the name of the action you gave to ClassMethods#web_service_scaffold.
|
||||
#
|
||||
@@ -122,7 +122,7 @@ module ActionWebService
|
||||
end
|
||||
|
||||
def scaffold_path(template_name)
|
||||
File.dirname(__FILE__) + "/templates/scaffolds/" + template_name + ".rhtml"
|
||||
File.dirname(__FILE__) + "/templates/scaffolds/" + template_name + ".erb"
|
||||
end
|
||||
|
||||
def reset_invocation_response
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<html>
|
||||
<head>
|
||||
<title><%= @scaffold_class.wsdl_service_name %> Web Service</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>
|
||||
|
||||
<%= @content_for_layout %>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,65 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title><%= @scaffold_class.wsdl_service_name %> Web Service</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>
|
||||
|
||||
<%= @content_for_layout %>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<% @scaffold_container.services.each do |service| %>
|
||||
|
||||
<h4>API Methods for <%= service %></h4>
|
||||
<%= service_method_list(service) %>
|
||||
|
||||
<% end %>
|
||||
@@ -1,6 +0,0 @@
|
||||
<% @scaffold_container.services.each do |service| %>
|
||||
|
||||
<h4>API Methods for <%= service %></h4>
|
||||
<%= service_method_list(service) %>
|
||||
|
||||
<% end %>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user