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
best_in_place
best_in_place
but here's another rich-text edit-in-place solution for Rails 3.2.x.I gave up trying to do this with best_in_place
, so this question as written is still open to a better answer. However, for those who might find this question later and wonder what I eventually came up with, here's what I did in the end:
best_in_place
. Anyway, if you're trying to do rich-text in-place editing in Rails 3.2, try the jeditable-wysiwyg-rails plugin. It's providing the assets for the markItUp editor as well, although because I'm not using it I'm not sure they're all there and/or arranged properly.
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