0

I have the rails application which accepts the XML output from another application. For some condition the XML tage content come up with CSS code

For example :

<\/sample/> .headermenu{float:left;no-repeat right;font-size:0.75em; padding-bottom:3px}, #div{float:left} This is the test value from another site <\/sample/>

In my ruby application i have parse the XML content and display the content.

It start displaying CSS content like the above. I want to display strip the CSS code if exist in the content.

Is their any way . we can do this please help...

4

2 回答 2

0

raw方法可能会对您有所帮助。它会在不转义字符串的情况下输出数据。
查看此处http://apidock.com/rails/ActionView/Helpers/RawOutputHelper/raw 了解更多详情。

于 2012-12-05T16:24:22.747 回答
-1

我不知道这是否是您正在寻找的,但是您可以在需要 rails 或 ruby​​ gem 时顺便尝试css 解析器,只需在 ruby ​​gems搜索即可

于 2012-12-05T14:53:45.557 回答