rorlab/summernote-rails — pull request #5 by sergey-kucher (2014-01-15 15:57:18+00:00)
Title: Fast form setup

# i think it can be helpful, but i can't find properly place.

# original coffee
window.apply_summernote_to = (form, fields...) ->
for field in fields
input = field['input']
input.summernote field
input.code input.val()
form.submit ->
for field in fields
input = field['input']
input.val input.code()

# it can be useful for fast form setup. Just like this:
$(document).ready ->
apply_summernote_to $('.simple_form.edit_post'),
{ input: $('#post_header'), height: 120 }
{ input: $('#post_content'), height: 500 }