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!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
<%= @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.