README.md in marcosinger-auto_html-1.3.5 vs README.md in marcosinger-auto_html-1.3.6
- old
+ new
@@ -45,50 +45,47 @@
def preview
comment = Comment.new(params[:comment])
render :text => comment.body_html
end
-Plugin is highly customizable, and you can easily create new filters that will transform user input any way you like. For instance, this is the image filter that comes bundled with plugin:
+AutoHtml is highly customizable, and you can easily create new filters that will transform user input any way you like. For instance, this is the image filter that comes bundled with plugin:
AutoHtml.add_filter(:image) do |text|
text.gsub(/http:\/\/.+\.(jpg|jpeg|bmp|gif|png)(\?\S+)?/i) do |match|
%|<img src="#{match}" alt=""/>|
end
end
+## Non-ActiveRecord models
-## Bundled filters
+AutoHtml uses standard ActiveModel API, which means that you can include AutoHtmlFor module (that automates transformation of the field) in any non-ActiveRecord model that uses ActiveModel. Here's working [mongoid](http://mongoid.org/) example:
-For filter list and options they support check: <http://github.com/dejan/auto_html/tree/master/lib/auto_html/filters>
+ class Post
+ include Mongoid::Document
+ include AutoHtmlFor
+ field :body
-## Install
+ auto_html_for :body do
+ simple_format
+ link
+ end
+ end
-### Important note on versions
-As from version 1.2.0 auto_html uses Rails' engine for discovering links. There are some bugs with that engine in versions under Rails 2.3.2. so it's recommended you use auto_html 1.1.2 in that case, since internal engine is used in that version.
+## Bundled filters
- for Rails <= 2.3.1 use auto_html 1.1.2<br/>
- for Rails >= 2.3.2 use the latest auto_html
+For filter list and options they support check: <http://github.com/dejan/auto_html/tree/master/lib/auto_html/filters>
-### As a gem
-To enable the library in your Rails 2.1-2.3 project, use the gem configuration method in "config/environment.rb"
+## Install
- Rails::Initializer.run do |config|
- config.gem 'auto_html'
- end
+Specify the gem in Gemfile of the project
-In Rails 3.0 specify the gem in your Gemfile
-
gem "auto_html"
-### As a Rails plugin
- script/plugin install git://github.com/dejan/auto_html.git
-
-
## Credits
Author: [Dejan Simic](http://github.com/dejan)<br/>
-Contributors: [Claudio Perez Gamayo](http://github.com/crossblaim), [Matt Polito](http://github.com/mattpolito), [Ryan Heneise](http://github.com/mysmallidea), [Caleb Wright](http://github.com/fabrikagency), [Derrick Camerino](https://github.com/robustdj)
+Contributors: [Claudio Perez Gamayo](https://github.com/crossblaim), [Matt Polito](https://github.com/mattpolito), [Ryan Heneise](https://github.com/mysmallidea), [Caleb Wright](https://github.com/fabrikagency), [Derrick Camerino](https://github.com/robustdj), [Daniel Weinmann](https://github.com/danielweinmann), [Edgars Beigarts](https://github.com/ebeigarts), [Henning Thies](https://github.com/henningthies), [rbq](https://github.com/rbq)