Ruby on Rails - WYSIWYG trix editor to best_in_place

677 Views Asked by At

I've been using trix editor as my WYSIWYG in my application so far. Now that I've added best_in_place gem for inline editing i would like to know if there is a way to implement trix editor or any other WYSIWYG editor, or if I have to change the best in place gem for some alternative since i need the WYSIWYG.

Integration of WYSIWYG editor to best-in-place textarea

This should be something similar, but I can't really figure it out.

$(document).on('best_in_place:activate', function(el) { 
     $(element).trix-editor(); 
});

doesn't seem to work.

Thank you!

1

There are 1 best solutions below

4
Josh Brody On

You should be able to do something like

$(document).on('best_in_place:activate', function(el) { 
    // code to initialize the editor on
    // $(element).editor(); ? 
});