1
我正在使用Ruby On Rails的RXML为Google创建站点地图Feed。如何在ruby rxml中跳过分号
谷歌要求images are marked up with the image name space,需要有这样中有一个分号的元素:如果我使用
xml.image:loc => "something"
<image:image>
<image:loc>http://example.com/image.jpg</image:loc>
</image:image>
我得到
<image:image>
<image loc="something"/>
</image:image>
如果我使用
xml.image:loc("something")
我得到
compile error
/home/vagrant/website/app/views/feeds/sitemap.rxml:36: syntax error, unexpected '(', expecting kEND
xml.image:loc("something")
如果我试试这个
xml.image:loc do
puts "something"
end
我得到这个
<image:image>
<image:loc>
</image:loc>
</image:image>
我没有足够的权限才能添加RXML作为标记。 – xiatica 2014-09-28 07:06:31