[uf-rest] REST opacity and URL schemes.

David Heinemeier Hansson david at loudthinking.com
Sat Apr 22 20:59:36 PDT 2006


>> #  POST    /books/4      --> { :controller => "books", :action =>  
>> "update", :id => 4 }
>
> If I understand Rails correctly, you are usually submitting key- 
> value pairs of a modified record, which is NOT identical to the  
> _actual_ row of the table.  Thus, "POST" would actually be the  
> correct semantics for what you are trying to accomplish.

Most forms, in this context, give you the entire record and you then  
use that to update the record. So it's

@book.attributes = params[:book]

When params[:book] will usually keep all of the attributes. At least  
all of the attributes that's intended for the user to see/edit.
--
David Heinemeier Hansson
http://www.37signals.com    -- Basecamp, Backpack, Writeboard, Tada
http://www.rubyonrails.com  -- Web-application framework
http://www.loudthinking.com -- Broadcasting Brain




More information about the microformats-rest mailing list