Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Keep the same API semantics for update/delete as we had for XML (just…

… return 200 OK, no body)
  • Loading branch information...
commit b93199b547303a1656282a2591db84de0b6d2a9f 1 parent 1d8bf4f
@dhh dhh authored
View
4 railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb
@@ -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 { render <%= key_value :json, '{}' %>, <%= key_value :status, ':ok' %> }
+ format.json { head :ok }
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 { render <%= key_value :json, '{}' %>, <%= key_value :status, ':ok' %> }
+ format.json { head :ok }
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.