문제

I have used MarkiItUp to build a jquery editor. Now when user type content in textarea with html code, like this:

A new <strong>true</strong> question

When record was saved, it save A new <strong>true</strong> question. And when it display on page, it also display like content was saved, is A new <strong>true</strong> question . But i want the content display on web like this:

A new true question

How can i do that?

도움이 되었습니까?

해결책

To display it, use html_safe. This way your string would be rendered as HTML.
Refer to this question for more info.
Ruby on Rails: how to render a string as HTML?

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