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