A website template with lots of features, built with ruby on rails.

blog_posts.js.coffee 1.0KB

    attachRatingHandler = -> # to set summernote object # You should change '#post_content' to your textarea input id summer_note = $('#blog_post_content') # to call summernote editor summer_note.summernote # to set options height:300 # toolbar: [ # ['insert', ['picture', 'link']], // no insert buttons # ["table", ["table"]], # ["style", ["style"]], # ["fontsize", ["fontsize"]], # ["color", ["color"]], # ["style", ["bold", "italic", "underline", "clear"]], # ["para", ["ul", "ol", "paragraph"]], # ["height", ["height"]], # ["help", ["help"]] #] # to set code for summernote summer_note.code summer_note.val() # to get code for summernote summer_note.closest('form').submit -> # alert $('#post_content').code() summer_note.val summer_note.code() true $(document).ready attachRatingHandler $(document).on "page:load", attachRatingHandler