rails 4 with CKeditor

后端 未结 6 773
死守一世寂寞
死守一世寂寞 2021-01-31 12:41

I cannot get the galetahub ckeditor gem to work with Rails 4 for me. I searched for any problems online but cannot find any. I\'m following the instructions exactly.

6条回答
  •  走了就别回头了
    2021-01-31 12:59

    STEP 1: Add gem 'paperclip' and gem "ckeditor" in your gemfile.

    STEP 2: Bundle Install.

    STEP 3: rails generate ckeditor:install --orm=active_record --backend=paperclip

    STEP 4: Place config.autoload_paths += %W(#{config.root}/app/models/ckeditor) in application.rb

    STEP 5: Place mount Ckeditor::Engine => "/ckeditor" if not present in routes.rb already and run db:migrate

    STEP 6: Open application.html.erb and place this <%= javascript_include_tag 'ckeditor/ckeditor.js' %> in header.

    STEP 7: Place this in footer(above the body tag) in application.html.erb

    
    

    STEP 8: Restart the WEBrick SERVER.

    That's it.

    Else

    Download the CKEditor Zip file, extract the files and place them in the sub directory “javascripts/ckeditor”, add the main JS file to the layout..

    javascript_include_tag 'ckeditor/ckeditor.js'
    

    Place this in footer(above the body tag) in application.html.erb

    
    

提交回复
热议问题