Reputation: 4203
In /views/documents/show.html.haml
, I have:
= raw @document.content
If @document.content stores HTML, such as <p>foo</p>
, I see "foo" formatted as a paragraph.
But if @document.content
stores HAML, such as %p foo
, I see the entered code, rather than "foo" formatted as a paragraph.
The same happens if I use...
= @document.content
...without the raw
.
Is there a solution?
Upvotes: 0
Views: 140
Reputation: 4203
Answer was:
- engine = Haml::Engine.new(@document.content)
= engine.render
Upvotes: 1