ActiveResource xml element ordering

I haven't, but e.g. the Builder API looks pretty straightforward:

:: and includes examples; maybe you should just try that and come
back if you have a specific problem :slight_smile:

thanks, I am not sure how to make my model convert to xml for POST
according to builder rules...
currently it uses a hash to represent all fields and calls hash.to_xml
but hash is unordered so no predictability. this is my specific problem

Hassan Schroeder wrote:

I am stuck.. here is what i tried
class SalesDocument < ActiveResource::Base
  def encode :template, 'rxml-file'

But that does not work. I get:

NoMethodError: protected method `render_to_string' called for

Are we talking about the same thing? How that even begins to relate to
escapes me...

Slava Mikerin wrote:

ok. I found solution :slight_smile:
Here is what I did

class SalesDocument < ActiveResource::Base
  def encode
    builder =>2)

Cool. BTW, it's more idiomatic Ruby to use do/end for multiline blocks
and save { } for one-liners.