Reputation: 1021
If I put the below code in .rb file
@expression_display = "Hi hello my name is <code>man</code>"
And in html.erb,
<%= @expression_display %>
But the display looks just like
Hi hello my name is <code>man</code>
, not the one with "man" part highlighted.
If I just put this sentence in html file, the "man" part will be highlighted because this part followed the code command.
How can I make this properly :) ?
Upvotes: 1
Views: 53
Reputation: 5778
If you are using Rails, you can use html_safe
like this:
<%= @expression_display.html_safe %>
Upvotes: 4
Reputation: 7214
You can use <%= raw(@expression_display) %>
raw
doesn't escape the string. see the doc here
Upvotes: 2