Search code examples
javascriptcssruby-on-railstwitter-bootstrap-3summernote

Icons not showing with summernote rails


enter image description here

I followed Summernote-rails official to add rich text editor in my Rails project.

Then in my edit.html.erb I added class place_editor to my text_area:

<%= f.text_area :text, class: "place_editor form-control col-md-7 col-xs-12", rows: "15j ,placeholder: "Text", required: "required"%>

and then JavaScript as:

<script type="text/javascript">
 $(function() {
      $('.place_editor').summernote();
      var edit = function () {
        $('.click2edit').summernote({ focus: true });
      };
      $("#edit").click(function () {
        $('.click2edit').summernote({ focus: true });
      });
      $("#save").click(function () {
        var aHTML = $('.click2edit').code(); //save HTML If you need(aHTML: array).
        $('.click2edit').destroy();
      });
      // Adding Css to give border to text editor
      $(".note-editor").css("border", "solid 1px #e7eaec");

    });
</script>

Everything works fine except ICONS.


Solution

  • I searched for hours and finally solved it. Actually, summernote doesn't save icons locally, instead it download it

    I added this links in header

      <link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
      <link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.1/summernote.css" rel="stylesheet">
    

    And it did the job I 'll welcome if someone can elaborate it further