【发布时间】:2016-06-19 23:31:46
【问题描述】:
我正在使用 summernote WYSIWYG editor 和 SimpleForm。
所以这个表单域:
<%= f.input :description, as: :summernote, placeholder: "Enter the description of the Job (e.g. 'Product Manager', 'Senior Ruby on Rails Developer')" %>
生成以下 HTML:
<textarea class="summernote optional" placeholder="Enter the description of the Job (e.g. 'Product Manager', 'Senior Ruby on Rails Developer')" data-provider="summernote" name="job[description]" id="job_description" style="display: none;"></textarea>
我的 SummerNote JS 执行如下:
ready = ->
$('[data-provider="summernote"]').each ->
$(this).summernote(height: 300, toolbar: [['style', ['bold', 'italic', 'underline', 'clear', 'fontname', 'fontsize', 'color']],
['font', ['strikethrough', 'superscript', 'subscript']], ['para', ['ul', 'ol', 'paragraph']],
['height', ['height']], ['insert', ['link', 'table', 'hr']]], placeholder: "Some placeholder copy")
$(document).ready(ready)
$(document).on('turbolinks:load', ready)
但是,我想提取表单中指定的值(即<textarea> 字段中的占位符),而不是Some placeholder copy。
我该怎么做?
【问题讨论】:
标签: jquery ruby-on-rails coffeescript ruby-on-rails-5