v3.1.0 - Show latest stable - 0 notes - Class: ActiveResource::Base
save() public

Saves (POST) or updates (PUT) a resource. Delegates to create if the object is new, update if it exists. If the response to the save includes a body, it will be assumed that this body is Json for the final object as it looked after the save (which would include attributes like created_at that weren’t part of the original submit).


my_company = => 'RoleModel Software', :owner => 'Ken Auer', :size => 2) # => true # sends POST /companies/ (create) # => false
my_company.size = 10 # sends PUT /companies/1 (update)
Show source
Register or log in to add new notes.