method
save
v3.0.7 -
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
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 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 # sends POST /companies/ (create) my_company.new? # => false my_company.size = 10 my_company.save # sends PUT /companies/1 (update)


