Created
April 26, 2012 15:37
-
-
Save hemju/2500433 to your computer and use it in GitHub Desktop.
three ways to use HTML in Rails translations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1: <%= t 'html.escaped' %> <!-- INCORRECT RESULT: <h2>lingohub</h2><p>can't wait to see it</p2> --> | |
2: <%= raw t('html.raw') %> <!-- CORRECT RESULT: <h2>lingohub</h2><p>can't wait to see it</p> --> | |
3: <%= t('html.html_safe').html_safe %> <!-- CORRECT RESULT: <h2>lingohub</h2><p>can't wait to see it</p> --> | |
4: <%= t 'html.ending_html' %> <!-- CORRECT RESULT: <h2>lingohub</h2><p>can't wait to see it</p> --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment