# ActiveResource Save and Create not passing data

**URL:** <https://www.ruby-forum.com/t/activeresource-save-and-create-not-passing-data/162130>\
**Category:** Rails\
**Created:** [March 6, 2009, 1:02am UTC](https://www.ruby-forum.com/t/activeresource-save-and-create-not-passing-data/162130 "2009-03-06T01:02:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewneal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4491bb/32.png) [@andrewneal](https://www.ruby-forum.com/u/andrewneal)\
**Post date:** [March 6, 2009, 1:02am UTC](https://www.ruby-forum.com/t/activeresource-save-and-create-not-passing-data/162130/1 "2009-03-06T01:02:42Z")

</div>

Hi all,

I am having an issue with ActiveResource that I hope someone can clear  
up for me.

For some reason I can’t get any data passed via the api to persist in  
the Database. If I create a new object, assign values to the parameters  
and save it, and empty object is created in the db. If I try an update  
an existing record the data doesn’t change. I have verified that I can  
make changes and add new object via the traditional UI, so I must be  
missing something.

#!/usr/bin/env ruby  
require ‘activeresource’

class TestServer \< ActiveResource::Base  
# ActiveResource needs to know the location  
# of the resource we’re connecting to,  
# plus the login, if required  
self.site = ‘[http://localhost:3000](http://localhost:3000)’  
self.element\_name =‘testservers’  
end

if have tried both

TS = TestServer.new(:name =\> “bbbbb”)  
TS.save

and

TS = TestServer.new  
TS.name= “bbbbb”  
TS.save

neither seems to work. Can anyone tell me what I am doing wrong here?

Thanks
