I have an intstance variable I am passing to a view, @body.
@body is a string with html in it.
<%= @body %> renders the string, not the html. How do I render the html in the string?
Possible?
Thanks in advance!
I have an intstance variable I am passing to a view, @body.
@body is a string with html in it.
<%= @body %> renders the string, not the html. How do I render the html in the string?
Possible?
Thanks in advance!
<%= @body %>
would output some html if you had some html in @body
.
It's a little weird to have html in that variable since the controller is not supposed to pass any HTML (The controller has to be view agnostic).
This is why we have some helper methods. Make a helper method that generates some html, and use it in your view.