I'm using the best_in_place
gem to do in-place editing in a Rails application. However, I need (X)HTML editing on some of the text areas, so I need a rich-text editor. TinyMCE is being used elsewhere on the site.
However, it's not trivial to add an editor to best_in_place
. To grossly oversimplify, the gem uses jQuery to insert the textarea
tag on the fly, and TinyMCE initializes at page load, replacing available textarea
s with an editor, so when best_in_place
puts in its textarea
, TinyMCE has already come and gone. I've tried re-initializing TinyMCE after best_in_place
inserts its textarea, but I don't think I've found the correct place(s) in the code to do that, because so far it hasn't worked.
There's a rumor that this integration is possible, but no documentation was visible in my web searches, so pointers are welcome. (Likewise this answer is unhelpful, pointing to two broken links.) I think my preferred order of solutions would be something like
- Here's how to integrate TinyMCE with
best_in_place
- It can't be done with TinyMCE but here's how to do it with another rich-text editor
- It can't be done with
best_in_place
but here's another rich-text edit-in-place solution for Rails 3.2.x.