crikos
unread,Jan 18, 2011, 4:43:31 PM1/18/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyamf
everybody,
i am changing from WebORB to Warhammerkids Rails3-amf - great choice,
even tehre are some open issues. One those issues is, how can I get
records from an association to the array, which is sent back to the
Flex-Application.
In WebORB the method of the controller looks like:
def getClients(clientFilter,myMandant)
clients = Client.find(:all, :conditions => {:account_id =>
myMandant}, :include => [:addresses, :contacts, :proofs])
end
in Rails3-amf I have a similar construction:
def getClients()
@clients = Client.find(:all, :conditions => {:account_id =>
params[1]}, :include => [:addresses, :contacts, :proofs])
respond_with(@clients) do |format|
format.amf { render :amf => @clients}
end
With this code I get back all correctly typed Client Objects as an
Array, but without the records from the ":include" argument.
How can I handle this ??
I also tried another way with:
....
respond_with(@clients) do |format|
format.amf { render :amf => @clients.to_amf(:include =>
[:addresses, :contacts, :proofs])}
....
With this try I got an error message" undefined method to_amf for
#<Array:0x88888888>.
Thanks for any help.