我試圖讓rails-ckeditor gem工作。我按照README上的說明進行操作。 但我得到這個錯誤未定義的方法`html_safe?'使用rails-ckeditor與formtastic時出錯
undefined method `html_safe?' for #<String:0xb6b6d080>
這是我formtastic表單代碼:
<%= f.input :content, :as => :ckeditor %>
任何想法?謝謝!
UPDATE 我使用Rails 2.3.8。這裏是堆棧跟蹤。
/usr/lib/ruby/gems/1.8/gems/ckeditor-3.4.3/lib/ckeditor/safe_buffer.rb:6:in `<<'
/usr/lib/ruby/gems/1.8/gems/ckeditor-3.4.3/lib/ckeditor/view_helper.rb:52:in `ckeditor_textarea'
/usr/lib/ruby/gems/1.8/gems/ckeditor-3.4.3/lib/ckeditor/formtastic.rb:9:in `send'
/usr/lib/ruby/gems/1.8/gems/ckeditor-3.4.3/lib/ckeditor/formtastic.rb:9:in `ckeditor_input'
/usr/lib/ruby/gems/1.8/gems/formtastic-1.1.0/lib/formtastic.rb:1281:in `send'
/usr/lib/ruby/gems/1.8/gems/formtastic-1.1.0/lib/formtastic.rb:1281:in `inline_input_for'
/usr/lib/ruby/gems/1.8/gems/formtastic-1.1.0/lib/formtastic.rb:109:in `send'
/usr/lib/ruby/gems/1.8/gems/formtastic-1.1.0/lib/formtastic.rb:109:in `input'
/usr/lib/ruby/gems/1.8/gems/formtastic-1.1.0/lib/formtastic.rb:108:in `map'
/usr/lib/ruby/gems/1.8/gems/formtastic-1.1.0/lib/formtastic.rb:108:in `input'
/home/shreyas/repos/citymgmt/app/views/articles/_form.html.erb:4
/home/shreyas/repos/citymgmt/app/views/articles/_form.html.erb:2:in `_run_erb_app47views47articles47_form46html46erb_locals_form_object'
/home/shreyas/repos/citymgmt/app/views/articles/_form.html.erb:1:in `_run_erb_app47views47articles47_form46html46erb_locals_form_object'
/home/shreyas/repos/citymgmt/app/views/articles/new.html.erb:10
/home/shreyas/repos/citymgmt/app/views/articles/new.html.erb:3:in `_run_erb_app47views47articles47new46html46erb'
是的,我使用Rails 2.3.2。 – Shreyas 2010-12-14 08:56:08