Rails 3.1 ckeditor

Jak*_*ake 5 rubygems ruby-on-rails ckeditor ruby-on-rails-3.1

所以我只是尝试在rails中安装ckeditor,但它看起来不像它的工作.

这就是我做的

将这些行添加到我的gemfile中

gem "ckeditor", "~> 3.6.0"
gem "paperclip"
Run Code Online (Sandbox Code Playgroud)

然后捆绑安装并运行

rails generate ckeditor:install
rails generate ckeditor:models --orm=active_record
Run Code Online (Sandbox Code Playgroud)

添加了这个文件tom config/application.rb

config.autoload_paths += %W(#{config.root}/app/models/ckeditor)
Run Code Online (Sandbox Code Playgroud)

然后我尝试了这段代码:

<%= javascript_include_tag :ckeditor %>
cktext_area_tag("test_area", "Ckeditor is the best")
cktext_area_tag("content", "Ckeditor", :input_html => {:cols => 10, :rows => 20}, :toolbar => 'Easy')
Run Code Online (Sandbox Code Playgroud)

但是,我得到的只是两个没有任何编辑能力的textareas.它们看起来像普通的textareas,我所能做的就是擦除和添加文本.

我究竟做错了什么?

jal*_*nge 1

这就像一个魅力,刚刚在 Rails 3.1.rc6 上测试过。还要小心您使用的宝石。截至本文发布时,官方 gem 尚未工作并正在等待拉取请求,因此请务必在您的 gemfile 中使用 fxposter 版本的 gem。

https://github.com/fxposter/rails_3_1_with_ckeditor_and_carrierwave