I have been experimenting with active resource recently but came across a problem. I receive a 404 error when trying to create a new object. The prescription object belongs to a device object.
Processing PrescriptionsController#create (for 127.0.0.1 at 2008-02-24 20:41:06) [POST] Session ID: 7bb36ceab59dfac446b7d21dd3c6a45e Parameters: {"format"=>"xml", "action"=>"create", "controller"=>"prescriptions", "prescription"=>{"device_id"=>4, "count"=>4}}
ActiveRecord::RecordNotFound (Couldn't find Device without an ID):
I have an activeresource class definition that looks like
class Prescription < ActiveResource::Base self.site = http://www.WEBHOST.com' #modified end
Then issue Prescription.create(:device_id => 1, :count => 1) which raises the above error. Other class definitions work flawlessly. What might be going on?