Closed zlx closed 11 years ago
views
<%= text_area_tag "page[content]", page.content(params[:locale]), :style=> "width: 1050px; height: 600px;", :id => 'page_content' %>
script
<script type="text/javascript">
$(function() { KindEditor.create('#page_content', {
uploadJson: '/kindeditor/upload',
allowFileManager: true,
fileManagerJson: '/kindeditor/filemanager',
langType : "<%= params[:locale] == 'cn' ? 'zh_CN' : 'en' %>"
}); });
</script>
It works!
You used the simple_form ?
I think you could need 'kindeditor_tag' helper:
<%= kindeditor_tag "page[content]", page.content(params[:locale]), :allowFileManager => true, :langType => (params[:locale] == 'cn' ? 'zh_CN' : 'en')%>
no need for extra javascript.
The README say, I can use
form.input 'content', :as => :kindeditor
but it donot work..env