我安装了Summernote编辑器,它应有的外观,但是当我单击“提交”时,它不会保存我的更改。
这是我的剧本:
$(document).ready(function () {
$('#summernote').summernote({
height: 300, // set editor height
minHeight: null, // set minimum height of editor
maxHeight: null, // set maximum height of editor
focus: true // set focus to editable area after initializing summernote
});
$('.dropdown-toggle').dropdown()
});
这是我的html/erb
:
<div class="control-label col-sm-2" id="summernote">
<%= f.label :description %>
</div>
<div class="col-sm-8" id="summernote">
<%= f.text_area :description, rows: 10, class: "form-control", placeholder:
"Description of article" %>
</div>
底部的文本区域可以工作,但是单击按钮时其中带有Description
的新Summernote文本区域不会更新文章。请让我知道我在想什么。