diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-04-25 21:10:27 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-04-25 21:10:27 +0000 |
commit | 9ff19d89b950a0c7e9dd073e7fbcfaed74628996 (patch) | |
tree | 8c0d2541175064e3ff50518575f52624e56324f3 /railties/lib/rails_generator | |
parent | 6a85955642606aa3159ea8e4d24fbc77a1fc5e94 (diff) | |
download | rails-9ff19d89b950a0c7e9dd073e7fbcfaed74628996.tar.gz rails-9ff19d89b950a0c7e9dd073e7fbcfaed74628996.tar.bz2 rails-9ff19d89b950a0c7e9dd073e7fbcfaed74628996.zip |
Resource scaffolding responds to new.xml. Closes #8185.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6579 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb | 6 |
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 |