setting collection members name?

5 views
Skip to first unread message

SMiX

unread,
Feb 17, 2011, 11:46:53 AM2/17/11
to restfulie
Hello.
I have a template

collection(@users, :root => "users") do |users|
users.members do |m, user|
m.values { |values|
values.email user.email
}
end
end

and get xml:


<?xml version="1.0"?>
<users>
<member>
<email>xwa...@gmail.comm</email>
</member>
<member>
<email>sam...@gmail.com</email>
</member>
</users>

How to tell restfulie to use `user` instead of `member`?

SMiX

unread,
Feb 17, 2011, 12:18:18 PM2/17/11
to restfulie
Solved.

users.members(:root => "user") do |m, user|

Guilherme Silveira

unread,
Feb 17, 2011, 12:33:29 PM2/17/11
to rest...@googlegroups.com, SMiX
Perfect...

If you want to contribute, this is a common question, you can post it
in the wiki and we will be very grateful :)

Regards

Guilherme Silveira
Caelum | Ensino e Inovação
http://www.caelum.com.br/

Reply all
Reply to author
Forward
0 new messages