Using sanitize within a Rails controller
you can use this ActionController::Base.helpers inside action method: class SiteController < ApplicationController def index render :text => ActionController::Base.helpers.sanitize(‘<b>bold</b>’) end end Hope this helps