Skip to content

Instantly share code, notes, and snippets.

@ygamretuta
Created October 17, 2015 01:08
Show Gist options
  • Save ygamretuta/4c8eda86e0df4fa904a1 to your computer and use it in GitHub Desktop.
Save ygamretuta/4c8eda86e0df4fa904a1 to your computer and use it in GitHub Desktop.
<!-- Rails automatically strips tags when outputting strings with html on them -->
<%= '<div>You are not alone</div>' %>
<!-- However, you may want to escape the HTML so that you can display the tags in the output -->
<%= h '<div>This will display with escaped html tags</div>' %>
<!-- There are some instances where you would want text with tags to be actually rendered -->
<%= raw '<div>I will be a div</div><br /><span>I will be under div</div>' %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment