我试过了:
after_initialize do
#code
end
Run Code Online (Sandbox Code Playgroud)
但是:(文件)
应用程序的某些部分,特别是观察者和路由,尚未在调用after_initialize块时设置.
我需要在我的代码中使用路由和记录器
有任何想法吗?
问题:
我观察到Chrome和Opera中的一个不良行为,当一个人通过删除它们之间的分隔来加入两个p标签时就会发生这种行为.Chrome和Opera删除contenteditable = false元素(小部件)和文本之后.
例:
HTML:
<div contenteditable="true" class="editor">
<p>This is the first paragraph.</p>
<p>←Place your cursor here and press backspace. <span class="widget" contenteditable="false">widget</span> Text after widget</p>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.widget{
display: inline-block;
padding: 5px;
background-color: gray;
}
.editor{
font: 20px Trebuchet MS
}
Run Code Online (Sandbox Code Playgroud)
题:
为什么?如何解决?