1

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

1
  • 2
    Try using either html_safe or raw. Commented May 14, 2014 at 14:00

1 Answer 1

3

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

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

2 Comments

Hi Pavan,Thank you for providing me these details. I will test this out later today.
Thank you very much Pavan. I used html_Safe and worked.

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.