【发布时间】:2015-06-08 21:08:24
【问题描述】:
我正在使用 Best in Place 编辑器在我的 Rails 应用程序中启用内联文本编辑器。
当我单击最佳位置元素时,它会显示一个空文本区域,而不是文本编辑器的当前值。例如,如果我有文本“测试项目”并单击最佳就地编辑器,它会将文本设置为“ ”,但是如果我单击最佳就地区域之外,它会返回到正确的静态文本。
这是该错误的视频: https://youtu.be/xA18Odj47sc
我的代码如下所示:
<%= best_in_place @collection, :name, :type => :textarea, :nil => @collection.name, :sanitize => false, :value => @collection.name %>
这就是页面上呈现的内容:
点击前:
<span class="best_in_place" id="best_in_place_collection_1_name" data-url="/collections/introduction-to-product-design--3" data-object="collection" data-attribute="name" data-nil="Test Project" data-type="textarea" data-sanitize="false">Test Project</span>
点击后:
<span class="best_in_place" id="best_in_place_collection_1_name" data-url="/collections/introduction-to-product-design--3" data-object="collection" data-attribute="name" data-nil="Test Project" data-type="textarea" data-sanitize="false">
<form action="javascript:void(0)" style="display:inline">
<textarea style="min-width: 193px; min-height: 66px; overflow: hidden;"></textarea>
<div style="position: absolute; display: none; word-wrap: break-word; font-weight: 400; width: 206px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; font-size: 14px; padding: 4px 6px;"> </div>
</form>
</span>
【问题讨论】:
标签: javascript jquery ruby-on-rails ruby best-in-place