How exactly DO you integrate ckeditor with Paperclip so it can upload image files?

前端 未结 5 722
走了就别回头了
走了就别回头了 2021-02-01 08:44

How do you get http://github.com/galetahub/rails-ckeditor working so you can upload image files? I don\'t think I\'ll use the s3 storage...

any help would be appreciate

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-01 09:29

    I would follow the README for the rails-ckeditor plugin you mentioned. If you don't need the SWFUpload, you can simply integrate the CKEditor and Paperclip, by writing a custom file uploader and custom file browser, and connect them to the editor by specifying urls and callback functions.

    It is always useful to have an example, the author has made an example app. Unfortunately, there are a few errors in it. Consider the following points to make it running

    1. change the following lines in config/environment.rb

      config.gem 'paperclip', :version => '2.3.3'

      config.gem 'ckeditor', :version => '3.4.1'

    2. delete the file index.html in public

    3. add a root route to config/routes.rb

      map.root :controller => "pages"

提交回复
热议问题