aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-02-21 00:29:44 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-02-21 00:29:44 +0000
commit21187c0fb4fc559927a2f947f909dedd85969ffb (patch)
treeefd0ceb5c3a88531916186e97aa106041c293975
parentb5419cd66ea160d1ee94f3ca521bb44adf3a21ca (diff)
downloadrails-21187c0fb4fc559927a2f947f909dedd85969ffb.tar.gz
rails-21187c0fb4fc559927a2f947f909dedd85969ffb.tar.bz2
rails-21187c0fb4fc559927a2f947f909dedd85969ffb.zip
Apply the rest of Chads patch
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionmailer/lib/action_mailer/base.rb20
-rw-r--r--actionmailer/test/fixtures/first_mailer/share.erb1
-rw-r--r--actionmailer/test/fixtures/first_mailer/share.rhtml1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_example_helper.erb1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_helper.erb1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_helper.rhtml1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_helper_method.erb1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb5
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml5
-rw-r--r--actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb1
-rw-r--r--actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml1
-rw-r--r--actionmailer/test/fixtures/second_mailer/share.erb1
-rw-r--r--actionmailer/test/fixtures/second_mailer/share.rhtml1
-rw-r--r--actionmailer/test/fixtures/templates/signed_up.erb3
-rw-r--r--actionmailer/test/fixtures/templates/signed_up.rhtml3
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb1
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml1
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb10
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml10
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb2
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml2
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb1
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml1
-rw-r--r--actionmailer/test/fixtures/test_mailer/signed_up.erb3
-rw-r--r--actionmailer/test/fixtures/test_mailer/signed_up.rhtml3
-rw-r--r--actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb3
-rw-r--r--actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml3
-rw-r--r--actionpack/examples/address_book/index.erb33
-rw-r--r--actionpack/examples/address_book/layout.erb8
-rw-r--r--actionpack/examples/debate/index.erb14
-rw-r--r--actionpack/examples/debate/new_topic.erb22
-rw-r--r--actionpack/examples/debate/topic.erb32
-rw-r--r--actionpack/lib/action_controller/templates/rescues/_request_and_response.erb44
-rw-r--r--actionpack/lib/action_controller/templates/rescues/_trace.erb26
-rw-r--r--actionpack/lib/action_controller/templates/rescues/diagnostics.erb11
-rw-r--r--actionpack/lib/action_controller/templates/rescues/layout.erb29
-rw-r--r--actionpack/lib/action_controller/templates/rescues/missing_template.erb2
-rw-r--r--actionpack/lib/action_controller/templates/rescues/routing_error.erb10
-rw-r--r--actionpack/lib/action_controller/templates/rescues/template_error.erb21
-rw-r--r--actionpack/lib/action_controller/templates/rescues/unknown_action.erb2
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/edit.erb7
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/layout.erb69
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/list.erb27
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/new.erb6
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/show.erb9
-rw-r--r--actionpack/test/fixtures/addresses/list.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_flash_method.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_headers_method.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_params_method.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_request_method.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_response_method.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.erb1
-rw-r--r--actionpack/test/fixtures/deprecated_instance_variables/_session_method.erb1
-rw-r--r--actionpack/test/fixtures/fun/games/hello_world.erb1
-rw-r--r--actionpack/test/fixtures/layouts/builder.builder3
-rw-r--r--actionpack/test/fixtures/layouts/standard.erb1
-rw-r--r--actionpack/test/fixtures/layouts/talk_from_action.erb2
-rw-r--r--actionpack/test/fixtures/layouts/yield.erb2
-rw-r--r--actionpack/test/fixtures/override/test/hello_world.erb1
-rw-r--r--actionpack/test/fixtures/scope/test/modgreet.erb1
-rw-r--r--actionpack/test/fixtures/test/_customer.erb1
-rw-r--r--actionpack/test/fixtures/test/_customer_greeting.erb1
-rw-r--r--actionpack/test/fixtures/test/_hash_object.erb1
-rw-r--r--actionpack/test/fixtures/test/_hello.builder1
-rw-r--r--actionpack/test/fixtures/test/_partial_only.erb1
-rw-r--r--actionpack/test/fixtures/test/_person.erb2
-rw-r--r--actionpack/test/fixtures/test/action_talk_to_layout.erb2
-rw-r--r--actionpack/test/fixtures/test/block_content_for.erb2
-rw-r--r--actionpack/test/fixtures/test/capturing.erb4
-rw-r--r--actionpack/test/fixtures/test/content_for.erb2
-rw-r--r--actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb1
-rw-r--r--actionpack/test/fixtures/test/erb_content_for.erb2
-rw-r--r--actionpack/test/fixtures/test/greeting.erb1
-rw-r--r--actionpack/test/fixtures/test/hello.builder4
-rw-r--r--actionpack/test/fixtures/test/hello_world.builder3
-rw-r--r--actionpack/test/fixtures/test/hello_world.erb1
-rw-r--r--actionpack/test/fixtures/test/hello_world_container.builder3
-rw-r--r--actionpack/test/fixtures/test/hello_world_with_layout_false.erb1
-rw-r--r--actionpack/test/fixtures/test/hello_xml_world.builder11
-rw-r--r--actionpack/test/fixtures/test/list.erb1
-rw-r--r--actionpack/test/fixtures/test/non_erb_block_content_for.builder4
-rw-r--r--actionpack/test/fixtures/test/potential_conflicts.erb4
-rw-r--r--actionpack/test/fixtures/test/render_file_with_ivar.erb1
-rw-r--r--actionpack/test/fixtures/test/render_file_with_locals.erb1
-rw-r--r--actionpack/test/fixtures/test/render_to_string_test.erb1
-rw-r--r--actionpack/test/fixtures/test/update_element_with_capture.erb9
-rw-r--r--actionwebservice/lib/action_web_service/scaffolding.rb10
-rw-r--r--actionwebservice/lib/action_web_service/templates/scaffolds/layout.erb65
-rw-r--r--actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml65
-rw-r--r--actionwebservice/lib/action_web_service/templates/scaffolds/methods.erb6
-rw-r--r--actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml6
-rw-r--r--actionwebservice/lib/action_web_service/templates/scaffolds/parameters.erb29
-rw-r--r--actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml29
-rw-r--r--actionwebservice/lib/action_web_service/templates/scaffolds/result.erb30
-rw-r--r--actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml30
-rw-r--r--actionwebservice/test/scaffolded_controller_test.rb10
-rw-r--r--railties/README4
-rw-r--r--railties/lib/rails_generator/commands.rb2
-rw-r--r--railties/lib/rails_generator/generators/components/controller/USAGE4
-rw-r--r--railties/lib/rails_generator/generators/components/controller/controller_generator.rb4
-rw-r--r--railties/lib/rails_generator/generators/components/controller/templates/view.erb2
-rw-r--r--railties/lib/rails_generator/generators/components/controller/templates/view.rhtml2
-rw-r--r--railties/lib/rails_generator/generators/components/mailer/USAGE2
-rw-r--r--railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb6
-rw-r--r--railties/lib/rails_generator/generators/components/mailer/templates/fixture.erb3
-rw-r--r--railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml3
-rw-r--r--railties/lib/rails_generator/generators/components/mailer/templates/view.erb3
-rw-r--r--railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml3
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb18
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/form.erb3
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml3
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.erb1
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml1
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/layout.erb17
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml17
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.erb9
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml9
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/view_list.erb27
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml27
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/view_new.erb8
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml8
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/view_show.erb8
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml8
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb6
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb4
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/layout.erb17
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/layout.rhtml17
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.erb19
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.rhtml19
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.erb24
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.rhtml24
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.erb18
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.rhtml18
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.erb10
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.rhtml10
144 files changed, 841 insertions, 378 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 5de9331674..044ff46587 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -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,
diff --git a/actionmailer/test/fixtures/first_mailer/share.erb b/actionmailer/test/fixtures/first_mailer/share.erb
new file mode 100644
index 0000000000..da43638ceb
--- /dev/null
+++ b/actionmailer/test/fixtures/first_mailer/share.erb
@@ -0,0 +1 @@
+first mail
diff --git a/actionmailer/test/fixtures/first_mailer/share.rhtml b/actionmailer/test/fixtures/first_mailer/share.rhtml
index da43638ceb..e69de29bb2 100644
--- a/actionmailer/test/fixtures/first_mailer/share.rhtml
+++ b/actionmailer/test/fixtures/first_mailer/share.rhtml
@@ -1 +0,0 @@
-first mail
diff --git a/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb b/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb
new file mode 100644
index 0000000000..fcff3bb1b4
--- /dev/null
+++ b/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb
@@ -0,0 +1 @@
+So, <%= example_format(@text) %>
diff --git a/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml b/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml
index fcff3bb1b4..e69de29bb2 100644
--- a/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml
+++ b/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml
@@ -1 +0,0 @@
-So, <%= example_format(@text) %>
diff --git a/actionmailer/test/fixtures/helper_mailer/use_helper.erb b/actionmailer/test/fixtures/helper_mailer/use_helper.erb
new file mode 100644
index 0000000000..378777f8bb
--- /dev/null
+++ b/actionmailer/test/fixtures/helper_mailer/use_helper.erb
@@ -0,0 +1 @@
+Hello, <%= person_name %>. Thanks for registering!
diff --git a/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml b/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml
index 378777f8bb..e69de29bb2 100644
--- a/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml
+++ b/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml
@@ -1 +0,0 @@
-Hello, <%= person_name %>. Thanks for registering!
diff --git a/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb b/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb
new file mode 100644
index 0000000000..d5b8b285e7
--- /dev/null
+++ b/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb
@@ -0,0 +1 @@
+This message brought to you by <%= name_of_the_mailer_class %>.
diff --git a/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml b/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml
index d5b8b285e7..e69de29bb2 100644
--- a/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml
+++ b/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml
@@ -1 +0,0 @@
-This message brought to you by <%= name_of_the_mailer_class %>.
diff --git a/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb b/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb
new file mode 100644
index 0000000000..96ec49d18a
--- /dev/null
+++ b/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb
@@ -0,0 +1,5 @@
+From "Romeo and Juliet":
+
+<%= block_format @text %>
+
+Good ol' Shakespeare.
diff --git a/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml b/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml
index 96ec49d18a..e69de29bb2 100644
--- a/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml
+++ b/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml
@@ -1,5 +0,0 @@
-From "Romeo and Juliet":
-
-<%= block_format @text %>
-
-Good ol' Shakespeare.
diff --git a/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb b/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb
new file mode 100644
index 0000000000..897a5065cf
--- /dev/null
+++ b/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb
@@ -0,0 +1 @@
+Have a lovely picture, from me. Enjoy! \ No newline at end of file
diff --git a/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml b/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml
index 897a5065cf..e69de29bb2 100644
--- a/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml
+++ b/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml
@@ -1 +0,0 @@
-Have a lovely picture, from me. Enjoy! \ No newline at end of file
diff --git a/actionmailer/test/fixtures/second_mailer/share.erb b/actionmailer/test/fixtures/second_mailer/share.erb
new file mode 100644
index 0000000000..9a54010672
--- /dev/null
+++ b/actionmailer/test/fixtures/second_mailer/share.erb
@@ -0,0 +1 @@
+second mail
diff --git a/actionmailer/test/fixtures/second_mailer/share.rhtml b/actionmailer/test/fixtures/second_mailer/share.rhtml
index 9a54010672..e69de29bb2 100644
--- a/actionmailer/test/fixtures/second_mailer/share.rhtml
+++ b/actionmailer/test/fixtures/second_mailer/share.rhtml
@@ -1 +0,0 @@
-second mail
diff --git a/actionmailer/test/fixtures/templates/signed_up.erb b/actionmailer/test/fixtures/templates/signed_up.erb
new file mode 100644
index 0000000000..a85d5fa442
--- /dev/null
+++ b/actionmailer/test/fixtures/templates/signed_up.erb
@@ -0,0 +1,3 @@
+Hello there,
+
+Mr. <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/templates/signed_up.rhtml b/actionmailer/test/fixtures/templates/signed_up.rhtml
index a85d5fa442..e69de29bb2 100644
--- a/actionmailer/test/fixtures/templates/signed_up.rhtml
+++ b/actionmailer/test/fixtures/templates/signed_up.rhtml
@@ -1,3 +0,0 @@
-Hello there,
-
-Mr. <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb
new file mode 100644
index 0000000000..6940419d47
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb
@@ -0,0 +1 @@
+Ignored when searching for implicitly multipart parts.
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml
index 6940419d47..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml
@@ -1 +0,0 @@
-Ignored when searching for implicitly multipart parts.
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb
new file mode 100644
index 0000000000..946d99ede5
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb
@@ -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>
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml
index 946d99ede5..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml
@@ -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>
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb
new file mode 100644
index 0000000000..a6c8d54cf9
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb
@@ -0,0 +1,2 @@
+Plain text to <%= @recipient %>.
+Plain text to <%= @recipient %>.
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml
index a6c8d54cf9..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml
@@ -1,2 +0,0 @@
-Plain text to <%= @recipient %>.
-Plain text to <%= @recipient %>.
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb
new file mode 100644
index 0000000000..c14348c770
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb
@@ -0,0 +1 @@
+yaml to: <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml
index c14348c770..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml
@@ -1 +0,0 @@
-yaml to: <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/signed_up.erb b/actionmailer/test/fixtures/test_mailer/signed_up.erb
new file mode 100644
index 0000000000..a85d5fa442
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/signed_up.erb
@@ -0,0 +1,3 @@
+Hello there,
+
+Mr. <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/signed_up.rhtml b/actionmailer/test/fixtures/test_mailer/signed_up.rhtml
index a85d5fa442..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/signed_up.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/signed_up.rhtml
@@ -1,3 +0,0 @@
-Hello there,
-
-Mr. <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb b/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb
new file mode 100644
index 0000000000..e8fb65d4d2
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb
@@ -0,0 +1,3 @@
+Hello there,
+
+Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml b/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml
index e8fb65d4d2..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml
@@ -1,3 +0,0 @@
-Hello there,
-
-Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %> \ No newline at end of file
diff --git a/actionpack/examples/address_book/index.erb b/actionpack/examples/address_book/index.erb
new file mode 100644
index 0000000000..217d39075c
--- /dev/null
+++ b/actionpack/examples/address_book/index.erb
@@ -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> \ No newline at end of file
diff --git a/actionpack/examples/address_book/layout.erb b/actionpack/examples/address_book/layout.erb
new file mode 100644
index 0000000000..931e141c01
--- /dev/null
+++ b/actionpack/examples/address_book/layout.erb
@@ -0,0 +1,8 @@
+<html>
+<head>
+ <title><%= @title || "Untitled" %></title>
+</head>
+<body>
+<%= @content_for_layout %>
+</body>
+</html> \ No newline at end of file
diff --git a/actionpack/examples/debate/index.erb b/actionpack/examples/debate/index.erb
new file mode 100644
index 0000000000..ddaa87da57
--- /dev/null
+++ b/actionpack/examples/debate/index.erb
@@ -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> \ No newline at end of file
diff --git a/actionpack/examples/debate/new_topic.erb b/actionpack/examples/debate/new_topic.erb
new file mode 100644
index 0000000000..f52a69cc31
--- /dev/null
+++ b/actionpack/examples/debate/new_topic.erb
@@ -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> \ No newline at end of file
diff --git a/actionpack/examples/debate/topic.erb b/actionpack/examples/debate/topic.erb
new file mode 100644
index 0000000000..e247c00f0d
--- /dev/null
+++ b/actionpack/examples/debate/topic.erb
@@ -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> \ No newline at end of file
diff --git a/actionpack/lib/action_controller/templates/rescues/_request_and_response.erb b/actionpack/lib/action_controller/templates/rescues/_request_and_response.erb
new file mode 100644
index 0000000000..fe60bfdd40
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/rescues/_request_and_response.erb
@@ -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>
diff --git a/actionpack/lib/action_controller/templates/rescues/_trace.erb b/actionpack/lib/action_controller/templates/rescues/_trace.erb
new file mode 100644
index 0000000000..b322b0aaae
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/rescues/_trace.erb
@@ -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> \ 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 @@
+<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) %>
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 @@
+<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.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 @@
+<h1>Template is missing</h1>
+<p><%=h @exception.message %></p>
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 @@
+<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.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 @@
+<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) %>
diff --git a/actionpack/lib/action_controller/templates/rescues/unknown_action.erb b/actionpack/lib/action_controller/templates/rescues/unknown_action.erb
new file mode 100644
index 0000000000..683379da10
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/rescues/unknown_action.erb
@@ -0,0 +1,2 @@
+<h1>Unknown action</h1>
+<p><%=h @exception.message %></p>
diff --git a/actionpack/lib/action_controller/templates/scaffolds/edit.erb b/actionpack/lib/action_controller/templates/scaffolds/edit.erb
new file mode 100644
index 0000000000..63dff602a1
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/scaffolds/edit.erb
@@ -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}" %>
diff --git a/actionpack/lib/action_controller/templates/scaffolds/layout.erb b/actionpack/lib/action_controller/templates/scaffolds/layout.erb
new file mode 100644
index 0000000000..759781e0e7
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/scaffolds/layout.erb
@@ -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>
diff --git a/actionpack/lib/action_controller/templates/scaffolds/list.erb b/actionpack/lib/action_controller/templates/scaffolds/list.erb
new file mode 100644
index 0000000000..fea23dc66f
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/scaffolds/list.erb
@@ -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}" %>
diff --git a/actionpack/lib/action_controller/templates/scaffolds/new.erb b/actionpack/lib/action_controller/templates/scaffolds/new.erb
new file mode 100644
index 0000000000..66f6626f4e
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/scaffolds/new.erb
@@ -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}" %>
diff --git a/actionpack/lib/action_controller/templates/scaffolds/show.erb b/actionpack/lib/action_controller/templates/scaffolds/show.erb
new file mode 100644
index 0000000000..46cdfdb493
--- /dev/null
+++ b/actionpack/lib/action_controller/templates/scaffolds/show.erb
@@ -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}" %>
diff --git a/actionpack/test/fixtures/addresses/list.erb b/actionpack/test/fixtures/addresses/list.erb
new file mode 100644
index 0000000000..c75e01eece
--- /dev/null
+++ b/actionpack/test/fixtures/addresses/list.erb
@@ -0,0 +1 @@
+We only need to get this far!
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.erb
new file mode 100644
index 0000000000..4e8a2d804c
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.erb
@@ -0,0 +1 @@
+<%= @cookies[:test] %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.erb
new file mode 100644
index 0000000000..68e88bb746
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.erb
@@ -0,0 +1 @@
+<%= cookies[:test] %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.erb
new file mode 100644
index 0000000000..4b4782b287
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.erb
@@ -0,0 +1 @@
+<%= @flash[:test] %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_flash_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_flash_method.erb
new file mode 100644
index 0000000000..f7f9d0913a
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_flash_method.erb
@@ -0,0 +1 @@
+<%= flash[:test] %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.erb
new file mode 100644
index 0000000000..1176c93ad8
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.erb
@@ -0,0 +1 @@
+<%= @headers[:test] %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_headers_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_headers_method.erb
new file mode 100644
index 0000000000..308c4eb6ba
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_headers_method.erb
@@ -0,0 +1 @@
+<%= headers[:test] %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.erb
new file mode 100644
index 0000000000..1eea68757f
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.erb
@@ -0,0 +1 @@
+<%= @params[:test] %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_params_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_params_method.erb
new file mode 100644
index 0000000000..7e349b4ca0
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_params_method.erb
@@ -0,0 +1 @@
+<%= params[:test] %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.erb
new file mode 100644
index 0000000000..a1680c23d5
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.erb
@@ -0,0 +1 @@
+<%= @request.method %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_request_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_request_method.erb
new file mode 100644
index 0000000000..0c74cf1c1b
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_request_method.erb
@@ -0,0 +1 @@
+<%= request.method %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.erb
new file mode 100644
index 0000000000..2f12d2ce32
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.erb
@@ -0,0 +1 @@
+<%= @response.body %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_response_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_response_method.erb
new file mode 100644
index 0000000000..948c75929a
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_response_method.erb
@@ -0,0 +1 @@
+<%= response.body %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.erb
new file mode 100644
index 0000000000..3acc1b8529
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.erb
@@ -0,0 +1 @@
+<%= @session[:test] %>
diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_session_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_session_method.erb
new file mode 100644
index 0000000000..a899387c47
--- /dev/null
+++ b/actionpack/test/fixtures/deprecated_instance_variables/_session_method.erb
@@ -0,0 +1 @@
+<%= session[:test] %>
diff --git a/actionpack/test/fixtures/fun/games/hello_world.erb b/actionpack/test/fixtures/fun/games/hello_world.erb
new file mode 100644
index 0000000000..1ebfbe2539
--- /dev/null
+++ b/actionpack/test/fixtures/fun/games/hello_world.erb
@@ -0,0 +1 @@
+Living in a nested world \ No newline at end of file
diff --git a/actionpack/test/fixtures/layouts/builder.builder b/actionpack/test/fixtures/layouts/builder.builder
new file mode 100644
index 0000000000..729af4b8bc
--- /dev/null
+++ b/actionpack/test/fixtures/layouts/builder.builder
@@ -0,0 +1,3 @@
+xml.wrapper do
+ xml << @content_for_layout
+end \ No newline at end of file
diff --git a/actionpack/test/fixtures/layouts/standard.erb b/actionpack/test/fixtures/layouts/standard.erb
new file mode 100644
index 0000000000..368764e6f4
--- /dev/null
+++ b/actionpack/test/fixtures/layouts/standard.erb
@@ -0,0 +1 @@
+<html><%= @content_for_layout %><%= @variable_for_layout %></html> \ No newline at end of file
diff --git a/actionpack/test/fixtures/layouts/talk_from_action.erb b/actionpack/test/fixtures/layouts/talk_from_action.erb
new file mode 100644
index 0000000000..187aab07a2
--- /dev/null
+++ b/actionpack/test/fixtures/layouts/talk_from_action.erb
@@ -0,0 +1,2 @@
+<title><%= @title || @content_for_title %></title>
+<%= @content_for_layout -%> \ No newline at end of file
diff --git a/actionpack/test/fixtures/layouts/yield.erb b/actionpack/test/fixtures/layouts/yield.erb
new file mode 100644
index 0000000000..482dc9022e
--- /dev/null
+++ b/actionpack/test/fixtures/layouts/yield.erb
@@ -0,0 +1,2 @@
+<title><%= yield :title %></title>
+<%= yield %>
diff --git a/actionpack/test/fixtures/override/test/hello_world.erb b/actionpack/test/fixtures/override/test/hello_world.erb
new file mode 100644
index 0000000000..3e308d3d86
--- /dev/null
+++ b/actionpack/test/fixtures/override/test/hello_world.erb
@@ -0,0 +1 @@
+Hello overridden world! \ No newline at end of file
diff --git a/actionpack/test/fixtures/scope/test/modgreet.erb b/actionpack/test/fixtures/scope/test/modgreet.erb
new file mode 100644
index 0000000000..8947726e89
--- /dev/null
+++ b/actionpack/test/fixtures/scope/test/modgreet.erb
@@ -0,0 +1 @@
+<p>Beautiful modules!</p> \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_customer.erb b/actionpack/test/fixtures/test/_customer.erb
new file mode 100644
index 0000000000..872d8c44e6
--- /dev/null
+++ b/actionpack/test/fixtures/test/_customer.erb
@@ -0,0 +1 @@
+Hello: <%= customer.name %> \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_customer_greeting.erb b/actionpack/test/fixtures/test/_customer_greeting.erb
new file mode 100644
index 0000000000..6acbcb20c4
--- /dev/null
+++ b/actionpack/test/fixtures/test/_customer_greeting.erb
@@ -0,0 +1 @@
+<%= greeting %>: <%= customer_greeting.name %> \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_hash_object.erb b/actionpack/test/fixtures/test/_hash_object.erb
new file mode 100644
index 0000000000..037a7368d6
--- /dev/null
+++ b/actionpack/test/fixtures/test/_hash_object.erb
@@ -0,0 +1 @@
+<%= hash_object[:first_name] %> \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_hello.builder b/actionpack/test/fixtures/test/_hello.builder
new file mode 100644
index 0000000000..ef52f632d1
--- /dev/null
+++ b/actionpack/test/fixtures/test/_hello.builder
@@ -0,0 +1 @@
+xm.hello \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_partial_only.erb b/actionpack/test/fixtures/test/_partial_only.erb
new file mode 100644
index 0000000000..a44b3eed40
--- /dev/null
+++ b/actionpack/test/fixtures/test/_partial_only.erb
@@ -0,0 +1 @@
+only partial \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/_person.erb b/actionpack/test/fixtures/test/_person.erb
new file mode 100644
index 0000000000..b2e5688956
--- /dev/null
+++ b/actionpack/test/fixtures/test/_person.erb
@@ -0,0 +1,2 @@
+Second: <%= name %>
+Third: <%= @name %>
diff --git a/actionpack/test/fixtures/test/action_talk_to_layout.erb b/actionpack/test/fixtures/test/action_talk_to_layout.erb
new file mode 100644
index 0000000000..36e896daa8
--- /dev/null
+++ b/actionpack/test/fixtures/test/action_talk_to_layout.erb
@@ -0,0 +1,2 @@
+<% @title = "Talking to the layout" -%>
+Action was here! \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/block_content_for.erb b/actionpack/test/fixtures/test/block_content_for.erb
new file mode 100644
index 0000000000..9510337365
--- /dev/null
+++ b/actionpack/test/fixtures/test/block_content_for.erb
@@ -0,0 +1,2 @@
+<% block_content_for :title do 'Putting stuff in the title!' end %>
+Great stuff! \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/capturing.erb b/actionpack/test/fixtures/test/capturing.erb
new file mode 100644
index 0000000000..1addaa40d9
--- /dev/null
+++ b/actionpack/test/fixtures/test/capturing.erb
@@ -0,0 +1,4 @@
+<% days = capture do %>
+ Dreamy days
+<% end %>
+<%= days %> \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/content_for.erb b/actionpack/test/fixtures/test/content_for.erb
new file mode 100644
index 0000000000..0e47ca8c3d
--- /dev/null
+++ b/actionpack/test/fixtures/test/content_for.erb
@@ -0,0 +1,2 @@
+<% content_for :title do %>Putting stuff in the title!<% end %>
+Great stuff! \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb b/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb
new file mode 100644
index 0000000000..8b8a449236
--- /dev/null
+++ b/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb
@@ -0,0 +1 @@
+The secret is <%= @secret %>
diff --git a/actionpack/test/fixtures/test/erb_content_for.erb b/actionpack/test/fixtures/test/erb_content_for.erb
new file mode 100644
index 0000000000..c3bdd13643
--- /dev/null
+++ b/actionpack/test/fixtures/test/erb_content_for.erb
@@ -0,0 +1,2 @@
+<% erb_content_for :title do %>Putting stuff in the title!<% end %>
+Great stuff! \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/greeting.erb b/actionpack/test/fixtures/test/greeting.erb
new file mode 100644
index 0000000000..62fb0293f0
--- /dev/null
+++ b/actionpack/test/fixtures/test/greeting.erb
@@ -0,0 +1 @@
+<p>This is grand!</p>
diff --git a/actionpack/test/fixtures/test/hello.builder b/actionpack/test/fixtures/test/hello.builder
new file mode 100644
index 0000000000..82a4a310d3
--- /dev/null
+++ b/actionpack/test/fixtures/test/hello.builder
@@ -0,0 +1,4 @@
+xml.html do
+ xml.p "Hello #{@name}"
+ xml << render_file("test/greeting")
+end \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/hello_world.builder b/actionpack/test/fixtures/test/hello_world.builder
new file mode 100644
index 0000000000..bffd2191ba
--- /dev/null
+++ b/actionpack/test/fixtures/test/hello_world.builder
@@ -0,0 +1,3 @@
+xml.html do
+ xml.p "Hello"
+end \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/hello_world.erb b/actionpack/test/fixtures/test/hello_world.erb
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionpack/test/fixtures/test/hello_world.erb
@@ -0,0 +1 @@
+Hello world! \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/hello_world_container.builder b/actionpack/test/fixtures/test/hello_world_container.builder
new file mode 100644
index 0000000000..e48d75c405
--- /dev/null
+++ b/actionpack/test/fixtures/test/hello_world_container.builder
@@ -0,0 +1,3 @@
+xml.test do
+ render :partial => 'hello', :locals => { :xm => xml }
+end \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/hello_world_with_layout_false.erb b/actionpack/test/fixtures/test/hello_world_with_layout_false.erb
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionpack/test/fixtures/test/hello_world_with_layout_false.erb
@@ -0,0 +1 @@
+Hello world! \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/hello_xml_world.builder b/actionpack/test/fixtures/test/hello_xml_world.builder
new file mode 100644
index 0000000000..02b14fe87c
--- /dev/null
+++ b/actionpack/test/fixtures/test/hello_xml_world.builder
@@ -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 \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/list.erb b/actionpack/test/fixtures/test/list.erb
new file mode 100644
index 0000000000..cd0ab45d26
--- /dev/null
+++ b/actionpack/test/fixtures/test/list.erb
@@ -0,0 +1 @@
+<%= @test_unchanged = 'goodbye' %><%= render_collection_of_partials "customer", @customers %><%= @test_unchanged %>
diff --git a/actionpack/test/fixtures/test/non_erb_block_content_for.builder b/actionpack/test/fixtures/test/non_erb_block_content_for.builder
new file mode 100644
index 0000000000..6ff6db0f95
--- /dev/null
+++ b/actionpack/test/fixtures/test/non_erb_block_content_for.builder
@@ -0,0 +1,4 @@
+content_for :title do
+ 'Putting stuff in the title!'
+end
+xml << "\nGreat stuff!" \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/potential_conflicts.erb b/actionpack/test/fixtures/test/potential_conflicts.erb
new file mode 100644
index 0000000000..a5e964e359
--- /dev/null
+++ b/actionpack/test/fixtures/test/potential_conflicts.erb
@@ -0,0 +1,4 @@
+First: <%= @name %>
+<%= render :partial => "person", :locals => { :name => "Stephan" } -%>
+Fourth: <%= @name %>
+Fifth: <%= name %> \ No newline at end of file
diff --git a/actionpack/test/fixtures/test/render_file_with_ivar.erb b/actionpack/test/fixtures/test/render_file_with_ivar.erb
new file mode 100644
index 0000000000..8b8a449236
--- /dev/null
+++ b/actionpack/test/fixtures/test/render_file_with_ivar.erb
@@ -0,0 +1 @@
+The secret is <%= @secret %>
diff --git a/actionpack/test/fixtures/test/render_file_with_locals.erb b/actionpack/test/fixtures/test/render_file_with_locals.erb
new file mode 100644
index 0000000000..ebe09faee6
--- /dev/null
+++ b/actionpack/test/fixtures/test/render_file_with_locals.erb
@@ -0,0 +1 @@
+The secret is <%= secret %>
diff --git a/actionpack/test/fixtures/test/render_to_string_test.erb b/actionpack/test/fixtures/test/render_to_string_test.erb
new file mode 100644
index 0000000000..6e267e8634
--- /dev/null
+++ b/actionpack/test/fixtures/test/render_to_string_test.erb
@@ -0,0 +1 @@
+The value of foo is: ::<%= @foo %>::
diff --git a/actionpack/test/fixtures/test/update_element_with_capture.erb b/actionpack/test/fixtures/test/update_element_with_capture.erb
new file mode 100644
index 0000000000..fa3ef200f9
--- /dev/null
+++ b/actionpack/test/fixtures/test/update_element_with_capture.erb
@@ -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 %>
diff --git a/actionwebservice/lib/action_web_service/scaffolding.rb b/actionwebservice/lib/action_web_service/scaffolding.rb
index e109857727..1ffe4eba77 100644
--- a/actionwebservice/lib/action_web_service/scaffolding.rb
+++ b/actionwebservice/lib/action_web_service/scaffolding.rb
@@ -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
diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/layout.erb b/actionwebservice/lib/action_web_service/templates/scaffolds/layout.erb
new file mode 100644
index 0000000000..167613f681
--- /dev/null
+++ b/actionwebservice/lib/action_web_service/templates/scaffolds/layout.erb
@@ -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>
diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml b/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml
index 167613f681..e69de29bb2 100644
--- a/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml
+++ b/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml
@@ -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>
diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/methods.erb b/actionwebservice/lib/action_web_service/templates/scaffolds/methods.erb
new file mode 100644
index 0000000000..60dfe23f07
--- /dev/null
+++ b/actionwebservice/lib/action_web_service/templates/scaffolds/methods.erb
@@ -0,0 +1,6 @@
+<% @scaffold_container.services.each do |service| %>
+
+ <h4>API Methods for <%= service %></h4>
+ <%= service_method_list(service) %>
+
+<% end %>
diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml b/actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml
index 60dfe23f07..e69de29bb2 100644
--- a/actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml
+++ b/actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml
@@ -1,6 +0,0 @@
-<% @scaffold_container.services.each do |service| %>
-
- <h4>API Methods for <%= service %></h4>
- <%= service_method_list(service) %>
-
-<% end %>
diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.erb b/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.erb
new file mode 100644
index 0000000000..767284e0d4
--- /dev/null
+++ b/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.erb
@@ -0,0 +1,29 @@
+<h4>Method Invocation Details for <em><%= @scaffold_service %>#<%= @scaffold_method.public_name %></em></h4>
+
+<% form_tag(:action => @scaffold_action_name + '_submit') do -%>
+<%= hidden_field_tag "service", @scaffold_service.name %>
+<%= hidden_field_tag "method", @scaffold_method.public_name %>
+
+<p>
+<label for="protocol">Protocol:</label><br />
+<%= select_tag 'protocol', options_for_select([['SOAP', 'soap'], ['XML-RPC', 'xmlrpc']], params['protocol']) %>
+</p>
+
+<% if @scaffold_method.expects %>
+
+<strong>Method Parameters:</strong><br />
+<% @scaffold_method.expects.each_with_index do |type, i| %>
+ <p>
+ <label for="method_params[<%= i %>]"><%= method_parameter_label(type.name, type) %> </label><br />
+ <%= method_parameter_input_fields(@scaffold_method, type, "method_params", i) %>
+ </p>
+<% end %>
+
+<% end %>
+
+<%= submit_tag "Invoke" %>
+<% end -%>
+
+<p>
+<%= link_to "Back", :action => @scaffold_action_name %>
+</p>
diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml b/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml
index 767284e0d4..e69de29bb2 100644
--- a/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml
+++ b/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml
@@ -1,29 +0,0 @@
-<h4>Method Invocation Details for <em><%= @scaffold_service %>#<%= @scaffold_method.public_name %></em></h4>
-
-<% form_tag(:action => @scaffold_action_name + '_submit') do -%>
-<%= hidden_field_tag "service", @scaffold_service.name %>
-<%= hidden_field_tag "method", @scaffold_method.public_name %>
-
-<p>
-<label for="protocol">Protocol:</label><br />
-<%= select_tag 'protocol', options_for_select([['SOAP', 'soap'], ['XML-RPC', 'xmlrpc']], params['protocol']) %>
-</p>
-
-<% if @scaffold_method.expects %>
-
-<strong>Method Parameters:</strong><br />
-<% @scaffold_method.expects.each_with_index do |type, i| %>
- <p>
- <label for="method_params[<%= i %>]"><%= method_parameter_label(type.name, type) %> </label><br />
- <%= method_parameter_input_fields(@scaffold_method, type, "method_params", i) %>
- </p>
-<% end %>
-
-<% end %>
-
-<%= submit_tag "Invoke" %>
-<% end -%>
-
-<p>
-<%= link_to "Back", :action => @scaffold_action_name %>
-</p>
diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/result.erb b/actionwebservice/lib/action_web_service/templates/scaffolds/result.erb
new file mode 100644
index 0000000000..5317688fcd
--- /dev/null
+++ b/actionwebservice/lib/action_web_service/templates/scaffolds/result.erb
@@ -0,0 +1,30 @@
+<h4>Method Invocation Result for <em><%= @scaffold_service %>#<%= @scaffold_method.public_name %></em></h4>
+
+<p>
+Invocation took <tt><%= '%f' % @method_elapsed %></tt> seconds
+</p>
+
+<p>
+<strong>Return Value:</strong><br />
+<pre>
+<%= h @method_return_value.inspect %>
+</pre>
+</p>
+
+<p>
+<strong>Request XML:</strong><br />
+<pre>
+<%= h @method_request_xml %>
+</pre>
+</p>
+
+<p>
+<strong>Response XML:</strong><br />
+<pre>
+<%= h @method_response_xml %>
+</pre>
+</p>
+
+<p>
+<%= link_to "Back", :action => @scaffold_action_name + '_method_params', :method => @scaffold_method.public_name, :service => @scaffold_service.name %>
+</p>
diff --git a/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml b/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml
index 5317688fcd..e69de29bb2 100644
--- a/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml
+++ b/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml
@@ -1,30 +0,0 @@
-<h4>Method Invocation Result for <em><%= @scaffold_service %>#<%= @scaffold_method.public_name %></em></h4>
-
-<p>
-Invocation took <tt><%= '%f' % @method_elapsed %></tt> seconds
-</p>
-
-<p>
-<strong>Return Value:</strong><br />
-<pre>
-<%= h @method_return_value.inspect %>
-</pre>
-</p>
-
-<p>
-<strong>Request XML:</strong><br />
-<pre>
-<%= h @method_request_xml %>
-</pre>
-</p>
-
-<p>
-<strong>Response XML:</strong><br />
-<pre>
-<%= h @method_response_xml %>
-</pre>
-</p>
-
-<p>
-<%= link_to "Back", :action => @scaffold_action_name + '_method_params', :method => @scaffold_method.public_name, :service => @scaffold_service.name %>
-</p>
diff --git a/actionwebservice/test/scaffolded_controller_test.rb b/actionwebservice/test/scaffolded_controller_test.rb
index 67e74a95ec..db73be17e3 100644
--- a/actionwebservice/test/scaffolded_controller_test.rb
+++ b/actionwebservice/test/scaffolded_controller_test.rb
@@ -73,30 +73,30 @@ class ScaffoldedControllerTest < Test::Unit::TestCase
def test_scaffold_invoke
get :scaffold_invoke
- assert_template 'methods.rhtml'
+ assert_template 'methods.erb'
end
def test_scaffold_invoke_method_params
get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'Hello'
- assert_template 'parameters.rhtml'
+ assert_template 'parameters.erb'
end
def test_scaffold_invoke_method_params_with_struct
get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'HelloStructParam'
- assert_template 'parameters.rhtml'
+ assert_template 'parameters.erb'
assert_tag :tag => 'form'
assert_tag :tag => 'input', :attributes => {:name => "method_params[0][name]"}
end
def test_scaffold_invoke_submit_hello
post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'Hello', :method_params => {'0' => '5', '1' => 'hello world'}
- assert_template 'result.rhtml'
+ assert_template 'result.erb'
assert_equal false, @controller.instance_eval{ @method_return_value }
end
def test_scaffold_invoke_submit_bye
post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'Bye'
- assert_template 'result.rhtml'
+ assert_template 'result.erb'
persons = [ScaffoldPerson.new(:id => 1, :name => "leon"), ScaffoldPerson.new(:id => 2, :name => "paul")]
assert_equal persons, @controller.instance_eval{ @method_return_value }
end
diff --git a/railties/README b/railties/README
index 0d6affddcd..7b0265321a 100644
--- a/railties/README
+++ b/railties/README
@@ -133,13 +133,13 @@ app/models
app/views
Holds the template files for the view that should be named like
- weblogs/index.rhtml for the WeblogsController#index action. All views use eRuby
+ weblogs/index.erb for the WeblogsController#index action. All views use eRuby
syntax.
app/views/layouts
Holds the template files for layouts to be used with views. This models the common
header/footer method of wrapping views. In your views, define a layout using the
- <tt>layout :default</tt> and create a file named default.rhtml. Inside default.rhtml,
+ <tt>layout :default</tt> and create a file named default.erb. Inside default.erb,
call <% yield %> to render the view using this layout.
app/helpers
diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb
index d9c471a915..db9a087f29 100644
--- a/railties/lib/rails_generator/commands.rb
+++ b/railties/lib/rails_generator/commands.rb
@@ -559,7 +559,7 @@ end_message
return
end
- logger.refreshing "#{template_options[:insert].gsub(/\.rhtml/,'')} inside #{relative_destination}"
+ logger.refreshing "#{template_options[:insert].gsub(/\.erb/,'')} inside #{relative_destination}"
begin_mark = Regexp.quote(template_part_mark(template_options[:begin_mark], template_options[:mark_id]))
end_mark = Regexp.quote(template_part_mark(template_options[:end_mark], template_options[:mark_id]))
diff --git a/railties/lib/rails_generator/generators/components/controller/USAGE b/railties/lib/rails_generator/generators/components/controller/USAGE
index ec64209135..ae7b8e022b 100644
--- a/railties/lib/rails_generator/generators/components/controller/USAGE
+++ b/railties/lib/rails_generator/generators/components/controller/USAGE
@@ -15,7 +15,7 @@ Example:
Credit card controller with URLs like /credit_card/debit.
Controller: app/controllers/credit_card_controller.rb
- Views: app/views/credit_card/debit.rhtml [...]
+ Views: app/views/credit_card/debit.erb [...]
Helper: app/helpers/credit_card_helper.rb
Test: test/functional/credit_card_controller_test.rb
@@ -24,7 +24,7 @@ Modules Example:
Credit card admin controller with URLs /admin/credit_card/suspend.
Controller: app/controllers/admin/credit_card_controller.rb
- Views: app/views/admin/credit_card/debit.rhtml [...]
+ Views: app/views/admin/credit_card/debit.erb [...]
Helper: app/helpers/admin/credit_card_helper.rb
Test: test/functional/admin/credit_card_controller_test.rb
diff --git a/railties/lib/rails_generator/generators/components/controller/controller_generator.rb b/railties/lib/rails_generator/generators/components/controller/controller_generator.rb
index c6703b4a17..f73e5a41b0 100644
--- a/railties/lib/rails_generator/generators/components/controller/controller_generator.rb
+++ b/railties/lib/rails_generator/generators/components/controller/controller_generator.rb
@@ -28,8 +28,8 @@ class ControllerGenerator < Rails::Generator::NamedBase
# View template for each action.
actions.each do |action|
- path = File.join('app/views', class_path, file_name, "#{action}.rhtml")
- m.template 'view.rhtml', path,
+ path = File.join('app/views', class_path, file_name, "#{action}.erb")
+ m.template 'view.erb', path,
:assigns => { :action => action, :path => path }
end
end
diff --git a/railties/lib/rails_generator/generators/components/controller/templates/view.erb b/railties/lib/rails_generator/generators/components/controller/templates/view.erb
new file mode 100644
index 0000000000..ad85431f98
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/controller/templates/view.erb
@@ -0,0 +1,2 @@
+<h1><%= class_name %>#<%= action %></h1>
+<p>Find me in <%= path %></p>
diff --git a/railties/lib/rails_generator/generators/components/controller/templates/view.rhtml b/railties/lib/rails_generator/generators/components/controller/templates/view.rhtml
index ad85431f98..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/controller/templates/view.rhtml
+++ b/railties/lib/rails_generator/generators/components/controller/templates/view.rhtml
@@ -1,2 +0,0 @@
-<h1><%= class_name %>#<%= action %></h1>
-<p>Find me in <%= path %></p>
diff --git a/railties/lib/rails_generator/generators/components/mailer/USAGE b/railties/lib/rails_generator/generators/components/mailer/USAGE
index f3c295ebd3..8224a25190 100644
--- a/railties/lib/rails_generator/generators/components/mailer/USAGE
+++ b/railties/lib/rails_generator/generators/components/mailer/USAGE
@@ -12,7 +12,7 @@ Example:
This will create a Notifications mailer class:
Mailer: app/models/notifications.rb
- Views: app/views/notifications/signup.rhtml [...]
+ Views: app/views/notifications/signup.erb [...]
Test: test/unit/test/unit/notifications_test.rb
Fixtures: test/fixtures/notifications/signup [...]
diff --git a/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb b/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb
index 764707da4c..3ff4f03972 100644
--- a/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb
+++ b/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb
@@ -21,12 +21,12 @@ class MailerGenerator < Rails::Generator::NamedBase
# View template and fixture for each action.
actions.each do |action|
relative_path = File.join(file_path, action)
- view_path = File.join('app/views', "#{relative_path}.rhtml")
+ view_path = File.join('app/views', "#{relative_path}.erb")
fixture_path = File.join('test/fixtures', relative_path)
- m.template "view.rhtml", view_path,
+ m.template "view.erb", view_path,
:assigns => { :action => action, :path => view_path }
- m.template "fixture.rhtml", fixture_path,
+ m.template "fixture.erb", fixture_path,
:assigns => { :action => action, :path => view_path }
end
end
diff --git a/railties/lib/rails_generator/generators/components/mailer/templates/fixture.erb b/railties/lib/rails_generator/generators/components/mailer/templates/fixture.erb
new file mode 100644
index 0000000000..6899257ddc
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/mailer/templates/fixture.erb
@@ -0,0 +1,3 @@
+<%= class_name %>#<%= action %>
+
+Find me in <%= path %>
diff --git a/railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml b/railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml
index 6899257ddc..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml
+++ b/railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml
@@ -1,3 +0,0 @@
-<%= class_name %>#<%= action %>
-
-Find me in <%= path %>
diff --git a/railties/lib/rails_generator/generators/components/mailer/templates/view.erb b/railties/lib/rails_generator/generators/components/mailer/templates/view.erb
new file mode 100644
index 0000000000..6899257ddc
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/mailer/templates/view.erb
@@ -0,0 +1,3 @@
+<%= class_name %>#<%= action %>
+
+Find me in <%= path %>
diff --git a/railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml b/railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml
index 6899257ddc..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml
+++ b/railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml
@@ -1,3 +0,0 @@
-<%= class_name %>#<%= action %>
-
-Find me in <%= path %>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb b/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb
index 759850f6bf..df622f7eee 100644
--- a/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb
+++ b/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb
@@ -81,12 +81,12 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
m.dependency 'model', [singular_name], :collision => :skip, :skip_migration => true
# Scaffolded forms.
- m.complex_template "form.rhtml",
+ m.complex_template "form.erb",
File.join('app/views',
controller_class_path,
controller_file_name,
- "_form.rhtml"),
- :insert => 'form_scaffolding.rhtml',
+ "_form.erb"),
+ :insert => 'form_scaffolding.erb',
:sandbox => lambda { create_sandbox },
:begin_mark => 'form',
:end_mark => 'eoform',
@@ -95,11 +95,11 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
# Scaffolded views.
scaffold_views.each do |action|
- m.template "view_#{action}.rhtml",
+ m.template "view_#{action}.erb",
File.join('app/views',
controller_class_path,
controller_file_name,
- "#{action}.rhtml"),
+ "#{action}.erb"),
:assigns => { :action => action }
end
@@ -120,10 +120,10 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
"#{controller_file_name}_helper.rb")
# Layout and stylesheet.
- m.template 'layout.rhtml',
+ m.template 'layout.erb',
File.join('app/views/layouts',
controller_class_path,
- "#{controller_file_name}.rhtml")
+ "#{controller_file_name}.erb")
m.template 'style.css', 'public/stylesheets/scaffold.css'
@@ -133,8 +133,8 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
path = File.join('app/views',
controller_class_path,
controller_file_name,
- "#{action}.rhtml")
- m.template "controller:view.rhtml", path,
+ "#{action}.erb")
+ m.template "controller:view.erb", path,
:assigns => { :action => action, :path => path}
end
end
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/form.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/form.erb
new file mode 100644
index 0000000000..d15f0d4ec2
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/form.erb
@@ -0,0 +1,3 @@
+<%%= error_messages_for '<%= singular_name %>' %>
+
+<%= template_for_inclusion %>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml
index d15f0d4ec2..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml
@@ -1,3 +0,0 @@
-<%%= error_messages_for '<%= singular_name %>' %>
-
-<%= template_for_inclusion %>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.erb
new file mode 100644
index 0000000000..c7a87553ac
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.erb
@@ -0,0 +1 @@
+<%= all_input_tags(@model_instance, @singular_name, {}) %> \ No newline at end of file
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml
index c7a87553ac..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml
@@ -1 +0,0 @@
-<%= all_input_tags(@model_instance, @singular_name, {}) %> \ No newline at end of file
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/layout.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/layout.erb
new file mode 100644
index 0000000000..5c1f304232
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/layout.erb
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+ <title><%= controller_class_name %>: <%%= controller.action_name %></title>
+ <%%= stylesheet_link_tag 'scaffold' %>
+</head>
+<body>
+
+<p style="color: green"><%%= flash[:notice] %></p>
+
+<%%= yield %>
+
+</body>
+</html>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml
index 5c1f304232..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml
@@ -1,17 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title><%= controller_class_name %>: <%%= controller.action_name %></title>
- <%%= stylesheet_link_tag 'scaffold' %>
-</head>
-<body>
-
-<p style="color: green"><%%= flash[:notice] %></p>
-
-<%%= yield %>
-
-</body>
-</html>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.erb
new file mode 100644
index 0000000000..a86aa0b0d5
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.erb
@@ -0,0 +1,9 @@
+<h1>Editing <%= singular_name %></h1>
+
+<%% form_tag :action => 'update<%= @suffix %>', :id => @<%= singular_name %> do %>
+ <%%= render :partial => 'form' %>
+ <%%= submit_tag 'Edit' %>
+<%% end %>
+
+<%%= link_to 'Show', :action => 'show<%= suffix %>', :id => @<%= singular_name %> %> |
+<%%= link_to 'Back', :action => 'list<%= suffix %>' %>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml
index a86aa0b0d5..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml
@@ -1,9 +0,0 @@
-<h1>Editing <%= singular_name %></h1>
-
-<%% form_tag :action => 'update<%= @suffix %>', :id => @<%= singular_name %> do %>
- <%%= render :partial => 'form' %>
- <%%= submit_tag 'Edit' %>
-<%% end %>
-
-<%%= link_to 'Show', :action => 'show<%= suffix %>', :id => @<%= singular_name %> %> |
-<%%= link_to 'Back', :action => 'list<%= suffix %>' %>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.erb
new file mode 100644
index 0000000000..3e2a414485
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.erb
@@ -0,0 +1,27 @@
+<h1>Listing <%= plural_name %></h1>
+
+<table>
+ <tr>
+ <%% for column in <%= model_name %>.content_columns %>
+ <th><%%= column.human_name %></th>
+ <%% end %>
+ </tr>
+
+<%% for <%= singular_name %> in @<%= plural_name %> %>
+ <tr>
+ <%% for column in <%= model_name %>.content_columns %>
+ <td><%%=h <%= singular_name %>.send(column.name) %></td>
+ <%% end %>
+ <td><%%= link_to 'Show', :action => 'show<%= suffix %>', :id => <%= singular_name %> %></td>
+ <td><%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => <%= singular_name %> %></td>
+ <td><%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?', :method => :post %></td>
+ </tr>
+<%% end %>
+</table>
+
+<%%= link_to 'Previous page', { :page => @<%= singular_name %>_pages.current.previous } if @<%= singular_name %>_pages.current.previous %>
+<%%= link_to 'Next page', { :page => @<%= singular_name %>_pages.current.next } if @<%= singular_name %>_pages.current.next %>
+
+<br />
+
+<%%= link_to 'New <%= singular_name %>', :action => 'new<%= suffix %>' %>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml
index 3e2a414485..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml
@@ -1,27 +0,0 @@
-<h1>Listing <%= plural_name %></h1>
-
-<table>
- <tr>
- <%% for column in <%= model_name %>.content_columns %>
- <th><%%= column.human_name %></th>
- <%% end %>
- </tr>
-
-<%% for <%= singular_name %> in @<%= plural_name %> %>
- <tr>
- <%% for column in <%= model_name %>.content_columns %>
- <td><%%=h <%= singular_name %>.send(column.name) %></td>
- <%% end %>
- <td><%%= link_to 'Show', :action => 'show<%= suffix %>', :id => <%= singular_name %> %></td>
- <td><%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => <%= singular_name %> %></td>
- <td><%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?', :method => :post %></td>
- </tr>
-<%% end %>
-</table>
-
-<%%= link_to 'Previous page', { :page => @<%= singular_name %>_pages.current.previous } if @<%= singular_name %>_pages.current.previous %>
-<%%= link_to 'Next page', { :page => @<%= singular_name %>_pages.current.next } if @<%= singular_name %>_pages.current.next %>
-
-<br />
-
-<%%= link_to 'New <%= singular_name %>', :action => 'new<%= suffix %>' %>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.erb
new file mode 100644
index 0000000000..8222ea622f
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.erb
@@ -0,0 +1,8 @@
+<h1>New <%= singular_name %></h1>
+
+<%% form_tag :action => 'create<%= @suffix %>' do %>
+ <%%= render :partial => 'form' %>
+ <%%= submit_tag "Create" %>
+<%% end %>
+
+<%%= link_to 'Back', :action => 'list<%= suffix %>' %>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml
index 8222ea622f..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml
@@ -1,8 +0,0 @@
-<h1>New <%= singular_name %></h1>
-
-<%% form_tag :action => 'create<%= @suffix %>' do %>
- <%%= render :partial => 'form' %>
- <%%= submit_tag "Create" %>
-<%% end %>
-
-<%%= link_to 'Back', :action => 'list<%= suffix %>' %>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.erb
new file mode 100644
index 0000000000..c9245cdfda
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.erb
@@ -0,0 +1,8 @@
+<%% for column in <%= model_name %>.content_columns %>
+<p>
+ <b><%%= column.human_name %>:</b> <%%=h @<%= singular_name %>.send(column.name) %>
+</p>
+<%% end %>
+
+<%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => @<%= singular_name %> %> |
+<%%= link_to 'Back', :action => 'list<%= suffix %>' %>
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml
index c9245cdfda..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml
@@ -1,8 +0,0 @@
-<%% for column in <%= model_name %>.content_columns %>
-<p>
- <b><%%= column.human_name %>:</b> <%%=h @<%= singular_name %>.send(column.name) %>
-</p>
-<%% end %>
-
-<%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => @<%= singular_name %> %> |
-<%%= link_to 'Back', :action => 'list<%= suffix %>' %>
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb b/railties/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb
index 112a7cf74f..502df6a567 100644
--- a/railties/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb
@@ -41,13 +41,13 @@ class ScaffoldResourceGenerator < Rails::Generator::NamedBase
for action in scaffold_views
m.template(
- "view_#{action}.rhtml",
- File.join('app/views', controller_class_path, controller_file_name, "#{action}.rhtml")
+ "view_#{action}.erb",
+ File.join('app/views', controller_class_path, controller_file_name, "#{action}.erb")
)
end
# Layout and stylesheet.
- m.template('layout.rhtml', File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.rhtml"))
+ m.template('layout.erb', File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.erb"))
m.template('style.css', 'public/stylesheets/scaffold.css')
m.template('model.rb', File.join('app/models', class_path, "#{file_name}.rb"))
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb
index 4ca12d622f..413f7f7ccb 100644
--- a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb
@@ -5,7 +5,7 @@ class <%= controller_class_name %>Controller < ApplicationController
@<%= table_name %> = <%= class_name %>.find(:all)
respond_to do |format|
- format.html # index.rhtml
+ format.html # index.erb
format.xml { render :xml => @<%= table_name %>.to_xml }
end
end
@@ -16,7 +16,7 @@ class <%= controller_class_name %>Controller < ApplicationController
@<%= file_name %> = <%= class_name %>.find(params[:id])
respond_to do |format|
- format.html # show.rhtml
+ format.html # show.erb
format.xml { render :xml => @<%= file_name %>.to_xml }
end
end
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/layout.erb b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/layout.erb
new file mode 100644
index 0000000000..5c1f304232
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/layout.erb
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+ <title><%= controller_class_name %>: <%%= controller.action_name %></title>
+ <%%= stylesheet_link_tag 'scaffold' %>
+</head>
+<body>
+
+<p style="color: green"><%%= flash[:notice] %></p>
+
+<%%= yield %>
+
+</body>
+</html>
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/layout.rhtml b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/layout.rhtml
index 5c1f304232..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/layout.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/layout.rhtml
@@ -1,17 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title><%= controller_class_name %>: <%%= controller.action_name %></title>
- <%%= stylesheet_link_tag 'scaffold' %>
-</head>
-<body>
-
-<p style="color: green"><%%= flash[:notice] %></p>
-
-<%%= yield %>
-
-</body>
-</html>
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.erb b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.erb
new file mode 100644
index 0000000000..bf165e02be
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.erb
@@ -0,0 +1,19 @@
+<h1>Editing <%= singular_name %></h1>
+
+<%%= error_messages_for :<%= singular_name %> %>
+
+<%% form_for(:<%= singular_name %>, :url => <%= singular_name %>_path(@<%= singular_name %>), :html => { :method => :put }) do |f| %>
+<% for attribute in attributes -%>
+ <p>
+ <b><%= attribute.column.human_name %></b><br />
+ <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
+ </p>
+
+<% end -%>
+ <p>
+ <%%= submit_tag "Update" %>
+ </p>
+<%% end %>
+
+<%%= link_to 'Show', <%= singular_name %>_path(@<%= singular_name %>) %> |
+<%%= link_to 'Back', <%= plural_name %>_path %> \ No newline at end of file
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.rhtml b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.rhtml
index bf165e02be..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.rhtml
@@ -1,19 +0,0 @@
-<h1>Editing <%= singular_name %></h1>
-
-<%%= error_messages_for :<%= singular_name %> %>
-
-<%% form_for(:<%= singular_name %>, :url => <%= singular_name %>_path(@<%= singular_name %>), :html => { :method => :put }) do |f| %>
-<% for attribute in attributes -%>
- <p>
- <b><%= attribute.column.human_name %></b><br />
- <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
- </p>
-
-<% end -%>
- <p>
- <%%= submit_tag "Update" %>
- </p>
-<%% end %>
-
-<%%= link_to 'Show', <%= singular_name %>_path(@<%= singular_name %>) %> |
-<%%= link_to 'Back', <%= plural_name %>_path %> \ No newline at end of file
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.erb b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.erb
new file mode 100644
index 0000000000..9ad899465c
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.erb
@@ -0,0 +1,24 @@
+<h1>Listing <%= plural_name %></h1>
+
+<table>
+ <tr>
+<% for attribute in attributes -%>
+ <th><%= attribute.column.human_name %></th>
+<% end -%>
+ </tr>
+
+<%% for <%= singular_name %> in @<%= plural_name %> %>
+ <tr>
+<% for attribute in attributes -%>
+ <td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>
+<% end -%>
+ <td><%%= link_to 'Show', <%= singular_name %>_path(<%= singular_name %>) %></td>
+ <td><%%= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>) %></td>
+ <td><%%= link_to 'Destroy', <%= singular_name %>_path(<%= singular_name %>), :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<%% end %>
+</table>
+
+<br />
+
+<%%= link_to 'New <%= singular_name %>', new_<%= singular_name %>_path %> \ No newline at end of file
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.rhtml b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.rhtml
index 9ad899465c..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.rhtml
@@ -1,24 +0,0 @@
-<h1>Listing <%= plural_name %></h1>
-
-<table>
- <tr>
-<% for attribute in attributes -%>
- <th><%= attribute.column.human_name %></th>
-<% end -%>
- </tr>
-
-<%% for <%= singular_name %> in @<%= plural_name %> %>
- <tr>
-<% for attribute in attributes -%>
- <td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>
-<% end -%>
- <td><%%= link_to 'Show', <%= singular_name %>_path(<%= singular_name %>) %></td>
- <td><%%= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>) %></td>
- <td><%%= link_to 'Destroy', <%= singular_name %>_path(<%= singular_name %>), :confirm => 'Are you sure?', :method => :delete %></td>
- </tr>
-<%% end %>
-</table>
-
-<br />
-
-<%%= link_to 'New <%= singular_name %>', new_<%= singular_name %>_path %> \ No newline at end of file
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.erb b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.erb
new file mode 100644
index 0000000000..b3b6f91453
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.erb
@@ -0,0 +1,18 @@
+<h1>New <%= singular_name %></h1>
+
+<%%= error_messages_for :<%= singular_name %> %>
+
+<%% form_for(:<%= singular_name %>, :url => <%= plural_name %>_path) do |f| %>
+<% for attribute in attributes -%>
+ <p>
+ <b><%= attribute.column.human_name %></b><br />
+ <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
+ </p>
+
+<% end -%>
+ <p>
+ <%%= submit_tag "Create" %>
+ </p>
+<%% end %>
+
+<%%= link_to 'Back', <%= plural_name %>_path %> \ No newline at end of file
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.rhtml b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.rhtml
index b3b6f91453..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.rhtml
@@ -1,18 +0,0 @@
-<h1>New <%= singular_name %></h1>
-
-<%%= error_messages_for :<%= singular_name %> %>
-
-<%% form_for(:<%= singular_name %>, :url => <%= plural_name %>_path) do |f| %>
-<% for attribute in attributes -%>
- <p>
- <b><%= attribute.column.human_name %></b><br />
- <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
- </p>
-
-<% end -%>
- <p>
- <%%= submit_tag "Create" %>
- </p>
-<%% end %>
-
-<%%= link_to 'Back', <%= plural_name %>_path %> \ No newline at end of file
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.erb b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.erb
new file mode 100644
index 0000000000..adecaf70c6
--- /dev/null
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.erb
@@ -0,0 +1,10 @@
+<% for attribute in attributes -%>
+<p>
+ <b><%= attribute.column.human_name %>:</b>
+ <%%=h @<%= singular_name %>.<%= attribute.name %> %>
+</p>
+
+<% end -%>
+
+<%%= link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>) %> |
+<%%= link_to 'Back', <%= plural_name %>_path %> \ No newline at end of file
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.rhtml b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.rhtml
index adecaf70c6..e69de29bb2 100644
--- a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.rhtml
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.rhtml
@@ -1,10 +0,0 @@
-<% for attribute in attributes -%>
-<p>
- <b><%= attribute.column.human_name %>:</b>
- <%%=h @<%= singular_name %>.<%= attribute.name %> %>
-</p>
-
-<% end -%>
-
-<%%= link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>) %> |
-<%%= link_to 'Back', <%= plural_name %>_path %> \ No newline at end of file