class Article < ActiveRecord::Base include ActionView::Helpers::SanitizeHelper
def before_create self.description = sanitize(self.description) end end
That's how I do it. This will be using Rails 2.0's whitelist sanitize helper.
class Article < ActiveRecord::Base include ActionView::Helpers::SanitizeHelper
def before_create self.description = sanitize(self.description) end end
That's how I do it. This will be using Rails 2.0's whitelist sanitize helper.