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 }