> So the behavior I want would look something like this (as an sample
> post.xml.builder view):
>
> xml.instruct!
> xml.active_record_model_tag!(@post, :attributes =>
> [:id, :body, :updated_at]) do
>  xml.active_record_model_tag!(@post.author)
> �[email protected] do |comment|
>    xml.active_record_model_tag!(comment, :attributes =>
> [:id, :body, :created_at], :methods => [:up_vote_percentage])
>  end
> end

You can actually get something pretty close to this already, it's just
'backwards' from how you're thinking about it:

xml.instruct!
@post.to_xml(:builder=>xml, :skip_instruct=>true)
@post.comments.each do |comment|
  comment.to_xml(:builder=>xml, :skip_instruct=>true)
end




-- 
Cheers

Koz

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to