Integration of WYSIWYG editor to best-in-place textarea

前端 未结 5 928
無奈伤痛
無奈伤痛 2021-02-15 10:54

I\'m using best_in_place gem to editing client\'s info in-place.

My question is, how can I integrate a WYSIWYG Editor for editing this content as HTML? I\'m currently us

5条回答
  •  一向
    一向 (楼主)
    2021-02-15 11:05

    You have to iterate over every element with class "wysihtml5" so it should be this way.

    $(function(){
      jQuery(".best_in_place").best_in_place();
      $.each('.wysihtml5', function(i, elem){
        $(elem).wysihtml5();
      });
    });
    

    And converted to Coffee with Js2Coffee it should work.

    $ ->
     jQuery(".best_in_place").best_in_place()
     $.each ".wysihtml5", (i, elem) ->
       $(elem).wysihtml5()   
    

提交回复
热议问题