Created
June 2, 2011 20:01
-
-
Save jrochkind/1005170 to your computer and use it in GitHub Desktop.
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
<%= form_tag ... do %> | |
<span>something</span> | |
<%= not_html_safe %> | |
<% end %> | |
That ends up making the entire block inside the form_tag do html escaped, which ordinarily isn't what happens in a view, but since it's inside a 'do' block, it does. | |
...which is why it's important for helper methods that return html to .html_safe it BEFORE they return it, like Rails own helpers do. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment