Is there a good ruby gem for a WYSIWYG editor that will easily work with a rails app?
Though it's certainly not a direct answer, in the past I've found I prefer to use RedCloth (or a Markdown parser if you don't enjoy Textile) and use a simple textarea with an AJAXy preview. Generally speaking, WYSIWYG editors have a long history of creating redundant tags and similar, leading to potentially broken pieces of HTML.
While I know this has been answered I wanted to add regarding the use of textile... I completely agree, but I'd recommend processing it in a before_save
filter. Let's say you have a database field called "details
" - just add one called "details_html
". Then do something like this...
before_save :convert_details
def convert_details
return if self.details.nil?
self.details_html = RedCloth.new(self.details).to_html
end
RedCloth can get a little process heavy and if you are constantly processing the stuff on each render you're going to run into some memory issues... this will just help lower some of your needed resources.
Update for 2010. I just implemented TinyMCE in a Rails app using the tinyMCE gem.
You can find it here: http://github.com/kete/tiny_mce
It took less than 5 minutes and in my basic testing, it's working perfectly. There was a commit in June 2010, so it looks like this is an actively developed gem.
Hope that helps some googlers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With