0
xml.instruct! :xml, :version=>"1.0" 
xml.urlset do
    xml.url do
        xml.title @tuan.title
        xml.url "http://www.geilibuy.com"+mytuan_url(@tuan)
        xml.data do
            xml.display do
                xml.website "dd"
            end
        end
    end
end

The above code can't be rendered as:

<data>
<display>dd</display>
</data>

The display node doesn't exist. It seems display may be a keyword of rails. Any help?

2 Answers 2

1

You can do

xml.tag!(:display) do
  # foobar
end

for things that are keywords etc.

Sign up to request clarification or add additional context in comments.

Comments

0

it's reallly display is a keywords of ruby,

so now i use xxx.xml.erb instead of xx.xml.builder

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.