Redcloth Textile
Posted by Scott Tue, 20 Mar 2007 18:14:00 GMT
LeadsOnRails is currently deployed on Rails 1.1.6. Yesterday I added Textilize/Redcloth to part of the program and found that paragraphs did not show up as expected. I could not get blank lines between paragraphs because paragraphs were broken only by
breaks, not
.
After a little googling I found this to be a common complaint and saw that there is a setting to specify hard breaks or not.
The simplest solution that seemed to work for me was to simply override the Rails implementation by putting this in helpers/application_helper.rb:
def textilize(str)
RedCloth.new(str).to_html
end
Is this dangerous in any way? Any reason not to do this this way?


Scott Meade is a corporate refugee and entrepreneur, a programmer turned manager turned business owner, a Rails developer, a husband, and a father of two living near Denver, CO.
Focussed on Ruby on Rails, this blog is seeded with Rails articles previously published in Synap Software's company blog.
