RailsCasts Pro episodes are now free!
Learn more or hide this
Resources
Update: as Santiago pointed out in the comments, it looks like XSS protection has been back-ported to Rails 2.3 and will be available in Rails 2.3.6.
<div class="comment"> <%= strong link_to(comment.name, comment.url) %> <p><%= comment.content %></p> </div>
# rails c "foo".html_safe? safe = "safe".html_safe safe.html_safe?
def strong(content) "<strong>#{h(content)}</strong>".html_safe end