Permalink
Browse files

Scaffold returns 204 No Content for API requests without content. Thi…

…s makes scaffold work with jQuery out of the box.
  • Loading branch information...
1 parent 20c59dd commit aef62c4b4e89e7fa91973c188c9e7f281a44ecd0 @josevalim josevalim committed Oct 26, 2011
View
@@ -1,5 +1,7 @@
*Rails 3.2.0 (unreleased)*
+* Scaffold returns 204 No Content for API requests without content. This makes scaffold work with jQuery out of the box. [José Valim]
+
* Updated Rails::Rack::Logger middleware to apply any tags set in config.log_tags to the newly ActiveSupport::TaggedLogging Rails.logger. This makes it easy to tag log lines with debug information like subdomain and request id -- both very helpful in debugging multi-user production applications [DHH]
* Default options to `rails new` can be set in ~/.railsrc [Guillermo Iguaran]
@@ -62,7 +62,7 @@ def update
respond_to do |format|
if @<%= orm_instance.update_attributes("params[:#{singular_table_name}]") %>
format.html { redirect_to @<%= singular_table_name %>, <%= key_value :notice, "'#{human_name} was successfully updated.'" %> }
- format.json { head :ok }
+ format.json { head :no_content }
else
format.html { render <%= key_value :action, '"edit"' %> }
format.json { render <%= key_value :json, "@#{orm_instance.errors}" %>, <%= key_value :status, ':unprocessable_entity' %> }
@@ -78,7 +78,7 @@ def destroy
respond_to do |format|
format.html { redirect_to <%= index_helper %>_url }
- format.json { head :ok }
+ format.json { head :no_content }
end
end
end

0 comments on commit aef62c4

Please sign in to comment.