diff options
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 9a14aeaa00..f95bcbb5c6 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Resource scaffolding responds to new.xml. #8185 [Eric Mill] + * Include Active Resource in rails:freeze:edge rake task. [Thomas Fuchs] * Include Active Resource instead of Action Web Service [DHH] You can add AWS back with this in config/environment.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 413f7f7ccb..f88299dd3d 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 @@ -22,8 +22,14 @@ class <%= controller_class_name %>Controller < ApplicationController end # GET /<%= table_name %>/new + # GET /<%= table_name %>/new.xml def new @<%= file_name %> = <%= class_name %>.new + + respond_to do |format| + format.html # new.erb + format.xml { render :xml => @<%= file_name %>.to_xml } + end end # GET /<%= table_name %>/1;edit |