aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator/generators/components/scaffold_resource
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails_generator/generators/components/scaffold_resource')
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb6
1 files changed, 6 insertions, 0 deletions
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