diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-10 23:04:19 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-10 23:04:19 +0000 |
commit | 5179b351c7375b06b267c16863124134935ffd17 (patch) | |
tree | 0afed4c7561664ca3ac0845dff2cef00f1eb793e /railties/lib/rails_generator | |
parent | fde3d9d8e432b0834d03888ff6e180359e038391 (diff) | |
download | rails-5179b351c7375b06b267c16863124134935ffd17.tar.gz rails-5179b351c7375b06b267c16863124134935ffd17.tar.bz2 rails-5179b351c7375b06b267c16863124134935ffd17.zip |
Scaffolded validation errors set the appropriate HTTP status for XML responses. Closes #8622.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6990 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb b/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb index bf47e8eba8..cbfd88f3bd 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb @@ -49,7 +49,7 @@ class <%= controller_class_name %>Controller < ApplicationController format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> } else format.html { render :action => "new" } - format.xml { render :xml => @<%= file_name %>.errors } + format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity } end end end @@ -66,7 +66,7 @@ class <%= controller_class_name %>Controller < ApplicationController format.xml { head :ok } else format.html { render :action => "edit" } - format.xml { render :xml => @<%= file_name %>.errors } + format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity } end end end |