galetahub/ckeditor — Issue #51: formtastic ckeditor field javascript requires :cols=> or throws error
Author: niedfelj
Created: 2011-11-08 16:13:34+00:00
State: open

I'm seeing this generated code in formtastic unless input_html is specified with :cols=>, in the javascript object cols: should have a default value if it is not specified or should not be entered in the hash.

f.input :body, :required => true, :as => :ckeditor

//
if (CKEDITOR.instances['content_body']) {CKEDITOR.remove(CKEDITOR.instances['content_body']);}CKEDITOR.replace('content_body', { cols: ,id: 'content_body',language: 'en',rows: 20 });
new:38 Uncaught SyntaxError: Unexpected token ,
//

It works correctly with this code:

f.input :body, :required => true, :as => :ckeditor, :input_html => {:cols=>10, :height => 400 }

//
if (CKEDITOR.instances['content_body']) {CKEDITOR.remove(CKEDITOR.instances['content_body']);}CKEDITOR.replace('content_body', { cols: 10,height: 400,id: 'content_body',language: 'en',rows: 20 });
//