Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3.1 ckeditor

So I just tried to install ckeditor in rails, however it doesn't look like its working.

Here is what I did

added these lines to my gemfile

gem "ckeditor", "~> 3.6.0"
gem "paperclip"

Then bundled installed and ran

rails generate ckeditor:install
rails generate ckeditor:models --orm=active_record

Added this file tom config/application.rb

config.autoload_paths += %W(#{config.root}/app/models/ckeditor)

And then I tried out this code:

<%= 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')

However, all I am getting is two textareas that do not have any editing ability. They look like normal textareas and all I can do is erase and add text.

What am I doing wrong?

like image 359
Jake Avatar asked Oct 10 '22 08:10

Jake


1 Answers

This works like a charm, just tested it on rails 3.1.rc6. Also be cautious of the gem you are using. As of the moment of this post, the oficial gem was not working and was waiting for a pull request, so be sure to use fxposter's version of the gem in your gemfile.

https://github.com/fxposter/rails_3_1_with_ckeditor_and_carrierwave

like image 164
jalagrange Avatar answered Oct 18 '22 13:10

jalagrange