Macrow / rails_kindeditor

Kindeditor for Ruby on Rails
260 stars 108 forks source link

刷新页面后无法创建KindEditor #65

Closed reasonpun closed 10 years ago

reasonpun commented 10 years ago

gem 'rails', '4.1.4'下安装了gem 'rails_kindeditor' 通过如下代码加载kindeditor $(document).on 'page:load', -> if $('#post_description').length > 0 KindEditor.create '#post_description', "width":"100%", "height":300, "allowFileManager":true, "uploadJson":"/kindeditor/upload", "fileManagerJson":"/kindeditor/filemanager", "items":["fontname","fontsize"...... erb代码这么写的:

<%= f.label :description, :class => 'control-label' %> <%= f.text_area :description, :class => 'text_area', :id => 'post_description' %>

首次进入页面可以成功加载KindEditor,但是刷新当前页面后不能成功创建KindEditor,请问下这是什么原因呢?非常感谢~

reasonpun commented 10 years ago

然后我改了下这个语句,貌似刷新页面也可以正常加载了 $(document).on 'ready page:load', ->....... thx~~~

Macrow commented 10 years ago

不错!