From 3008188cd6c0cca8789e8b7c57a4f896e2ff07d5 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Fri, 24 Feb 2012 16:35:48 -0800 Subject: consistently mention first patch, then put There was a mix, sometimes patch first, sometimes put first. Use always patch first, since this is going to be the primary verb for updates. --- railties/lib/rails/generators/active_model.rb | 6 +++--- .../generators/rails/scaffold_controller/templates/controller.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/active_model.rb b/railties/lib/rails/generators/active_model.rb index f51028b657..454327f765 100644 --- a/railties/lib/rails/generators/active_model.rb +++ b/railties/lib/rails/generators/active_model.rb @@ -37,7 +37,7 @@ module Rails # GET show # GET edit - # PUT/PATCH update + # PATCH/PUT update # DELETE destroy def self.find(klass, params=nil) "#{klass}.find(#{params})" @@ -58,13 +58,13 @@ module Rails "#{name}.save" end - # PUT/PATCH update + # PATCH/PUT update def update_attributes(params=nil) "#{name}.update_attributes(#{params})" end # POST create - # PUT/PATCH update + # PATCH/PUT update def errors "#{name}.errors" end diff --git a/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb b/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb index 566d78c6eb..ee49534a04 100644 --- a/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb +++ b/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb @@ -54,8 +54,8 @@ class <%= controller_class_name %>Controller < ApplicationController end end - # PUT/PATCH <%= route_url %>/1 - # PUT/PATCH <%= route_url %>/1.json + # PATCH/PUT <%= route_url %>/1 + # PATCH/PUT <%= route_url %>/1.json def update @<%= singular_table_name %> = <%= orm_class.find(class_name, "params[:id]") %> -- cgit v1.2.3