Problems with rendering amf

20 views
Skip to first unread message

crikos

unread,
Jan 15, 2011, 9:08:18 PM1/15/11
to rubyamf
Hi - I am new to this group and also new with RubyAMF. I have a
problem getting back typed Objects from RubyAMF within a Flex
application.

The method in my controller looks like:
...
def find_by_username_and_password()
debugger
@user = User.find_by_username_and_password(params[0],params[1])
render :amf => @user
end
....

executing the line "render :amf ...." brings following message in
Debugger-Mode:

default_render unless response_body

The Console window shows:

"Rendered text template"



in my flex Application I get back an Object from type ObjectProxy, but
it should be of type UserVO.

I am using following versions:
Flex 3.5 with cairngorm 2.2.1
Rails 3.0.3
Rake 0.8.7
Ruby 1.9.2p0

Everything is running on a iMac with OS X 10.6.6

Does anybody have an idea about that ?
Thanks in advance for helping.

Mark W. Foster

unread,
Jan 16, 2011, 3:47:32 PM1/16/11
to rub...@googlegroups.com
Several things:

1. RubyAMF has not been made completely Rails 3 compatible. One the of the
changes is that there is a default responder for errors and RubyAMF has not
been upgraded to accommodate that. So, it looks for a html template as the
redirect. If you don't have an untrapped error, everything is fine. So, you
might want to trap your find as a first step and see if there is an error.

2. I presume you have specifically referenced your class in your flex app.
If not, it will never be typed, because it is not compiled in the app. I
always use something like:

var public classes:Array = [User];

so that the class is referenced.

Hope that moves you forward.

Mark

default_render unless response_body

The Console window shows:

"Rendered text template"

--
You received this message because you are subscribed to the Google Groups
"rubyamf" group.
To post to this group, send email to rub...@googlegroups.com.
To unsubscribe from this group, send email to
rubyamf+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyamf?hl=en.

crikos

unread,
Jan 18, 2011, 4:59:06 PM1/18/11
to rubyamf
Thank you very much,
I switched to Rails3-amf - there most things are running really good,
even the configuration part is not so much work (e.g. attributes).
Thats important for me, because I am migrating from WebORB.

Regards
Reply all
Reply to author
Forward
0 new messages