Skip to content

asquared/sanitizes_html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SanitizesHtml
=============

A very simple model-based plugin to remove HTML tags from an attribute.
Requires Hpricot.


Example
=======

class Page < ActiveRecord::Base
  sanitizes_html :body, :allowed_tags => [ 'p', 'b', 'i', 'u', 'img' ], :safe_attributes => { 'img' => [ 'alt', 'src' ] }
end


Copyright (c) 2009 Andrew Armenia, released under the MIT license

About

simple HTML sanitization for Rails, reinventing the wheel perhaps?

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages