method
save
v2.0.1 -
Show latest stable
-
0 notes -
Class: ActiveResource::Base
- 1.0.0
- 1.1.0
- 1.1.1
- 1.1.6
- 1.2.0
- 1.2.6
- 2.0.0 (0)
- 2.0.1 (0)
- 2.0.3 (0)
- 2.1.0 (-15)
- 2.2.1 (8)
- 2.3.2 (0)
- 2.3.8 (0)
- 3.0.0 (-23)
- 3.0.5 (0)
- 3.0.7 (0)
- 3.0.9 (-38)
- 3.1.0 (2)
- 3.2.1 (0)
- 3.2.3 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- What's this?
save()
public
A method to save (POST) or update (PUT) a resource. It delegates to create if a new object, update if it is existing. If the response to the save includes a body, it will be assumed that this body is XML 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).
Examples
my_company = Company.new(:name => 'RoleModel Software', :owner => 'Ken Auer', :size => 2) my_company.new? # => true my_company.save # => POST /companies/ (create) my_company.new? # => false my_company.size = 10 my_company.save # => PUT /companies/1 (update)


