Redcloth Template plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install http://dev.diarrhea.ch/svn/rails_plugins/trunk/redcloth_template/
Use the class method auto_convert to specify fields, and pass symbols for the helpers in the :with option:
class MyModel < ActiveRecord::Base auto_convert :name, :text, :with => :strip_tags end
You can specify multiple helpers by passing an array. The helpers will be run in the order they’re specified in:
class MyModel < ActiveRecord::Base auto_convert :name, :text, :with => [ :strip_tags, :simple_format ] end
For more complex cases, pass a block which will be given the value. The helpers are also available in the context of the block:
class MyModel < ActiveRecord::Base auto_convert :name, :text do |value| strip_tags(value).strip.gsub(/[^\w ]/, '') end end
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, 10 months ago

