我有这一法典:
require rubygems
require activeresource
ActiveResource::Base.logger = Logger.new("#{File.dirname(__FILE__)}/exercises.log")
class Exercise < ActiveResource::Base
self.site = "http://localhost"
exercises = Exercise.find(:all)
ex = Exercise.find(741)
ex.name += "_TEST"
ex.save
end
而为拯救创造的尿素是
POST http://localhost/exercises.xml
结果是产生了新的记录,而不是更新现有的记录。
我本会期望这艘船长会到来。
PUT http://localhost/exercises/741.xml
当然,我期待更新现有记录。
是否有任何想法需要研究?
增 编