Stumped on RXML Template

Hi all,

I have a bit of a problem and don't know how to proceed:

I have the following RXML Template that:

Robert Walker wrote:

xml.instruct!
xml.articles do
  for article in @articles
    xml.article do
      xml.id(article.id, :type => 'integer')
      xml.created_at(article.created_at.xmlschema, :type =>
'datetime')
      xml.title(article.title)
      xml.author do
        xml.id(author.id, :type => 'integer')
        xml.first_name(author.first_name)
        xml.last_name(author.last_name)
      end
    end
  end
end

I can't figure out how to conditionally include the author tag in the
XML only if article.author is not nil.

Try

...
       xml.author do
         xml.id(article.author.id, :type => 'integer')
         xml.first_name(article.author.first_name)
         xml.last_name(article.author.last_name)
       end if article.author
...

b