The sanitize helper will html encode all tags and strip all attributes that aren’t specifically allowed.
sanitize @article.body,:tags => %w(br)
链接到API Docs.