Forum: Ruby on Rails render :partial, :collection in RXML templates

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3dd4b52a0946bd698b1d1635a46ea3a3?d=identicon&s=25 francois.beausoleil (Guest)
on 2005-11-30 03:44
(Received via mailing list)
Hi !

Is this expected to work:
xml.instruct!(:xml, :encoding => 'ISO-8859-1')
xml.contacts do
  render :partial => 'contact_xml', :collection => @contacts
end

Considering that contact_xml is a partial named '_contact_xml.rxml' ?
I get an empty contacts element in the resulting document, and the
@contacts array sure does contain two elements.

Thanks !
5b9fe87ec1faa67a4599782930f45ec9?d=identicon&s=25 sstephenson (Guest)
on 2005-11-30 04:37
(Received via mailing list)
Hi Francois,

On 11/29/05, Francois Beausoleil <francois.beausoleil@gmail.com> wrote:
> @contacts array sure does contain two elements.
Try:

  xml.contacts do
    xml << render :partial => ...
  end

--
sam
3dd4b52a0946bd698b1d1635a46ea3a3?d=identicon&s=25 francois.beausoleil (Guest)
on 2005-12-02 08:52
(Received via mailing list)
Hello Sam !

2005/11/29, Sam Stephenson <sstephenson@gmail.com>:
> Try:
>   xml.contacts do
>     xml << render :partial => ...
>   end

Sorry for the late reply.  Works like a charm !

Thanks !
This topic is locked and can not be replied to.