# ActiveResource - Two simple questions

**URL:** <https://www.ruby-forum.com/t/activeresource-two-simple-questions/175260>\
**Category:** Rails\
**Created:** [September 10, 2009, 9:29am UTC](https://www.ruby-forum.com/t/activeresource-two-simple-questions/175260 "2009-09-10T09:29:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Richardson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e495f1/32.png) [@Samuel\_Richardson](https://www.ruby-forum.com/u/Samuel_Richardson)\
**Post date:** [September 10, 2009, 9:29am UTC](https://www.ruby-forum.com/t/activeresource-two-simple-questions/175260/1 "2009-09-10T09:29:07Z")

</div>

I’m struggling a bit with implementing ActiveResource on a custom  
RESTful API.

Firstly, I can’t seem to disable the transforms it does when it parses  
the XML. For example “CamelCase” gets rendered as camel\_case, likewise  
underscores get converted to dashes. The docs page for ActiveResource  
mentions being able to set

ActiveSupport.camelise\_xml = false

In an initializer to disable this. This throws an error. I think I can  
get around the naming problems by converting the hash into XML with  
the correct formatting then back into a hash again. This seems crazy.

Secondly, when constructing forms using form\_for on ActiveResource  
objects, it throws a method not found because it has not loaded a  
schema for the ActiveResource (unlike ActiveRecord). To get around  
this, I’ve patched ActiveResource to return nils no methods that are  
not found, however I’ve run into a further problem with nested  
resources, for example:

contacts.phones.home

Throws a method not found on the home. How can I get around this? How  
can I manually construct an ActiveResource object to include this  
child nodes so I can wrap form\_for around them.

Sam
