문제

Not sure what I am doing wrong. I have a string which is a snippet of HTML. I am using the <%= %> erb tags to have it displayed. However, it does not render it as a HTML. It is stripping the tags and inserting characters

The source ERB snippet can be found here

The html tags seems to be stripped , but instead is replaces with comes out as "& lt span class=&# x27;" . The source can be seen here

도움이 되었습니까?

해결책

As i said, try using either html_safe or raw

<%= sent_array.join('').html_safe %>

OR

<%= raw sent_array.join('') %>

OR

<%== sent_array.join('') %>

<%== is equivalent to raw

For more details,see these Guides. In your case,you can also refer to safe_join

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top