Skip to content

Instantly share code, notes, and snippets.

@jrochkind
Created June 2, 2011 20:01
Show Gist options
  • Save jrochkind/1005170 to your computer and use it in GitHub Desktop.
Save jrochkind/1005170 to your computer and use it in GitHub Desktop.
<%= 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