我已经使用了现有网站。集成CMS(舒适的墨西哥沙发)。然后安装Redactor。抛出Redactor我有能力添加内容并在localhost:3000上显示它。我也有能力上传文件。我在内容框中使用其插入图像功能遇到问题。
我的服务器日志:
Started POST "/admin/sites/2/pages/2/null?ajax=1" for 127.0.0.1 at 2015-09-22 01:26:44 -0400
ActionController::RoutingError (No route matches [POST] "/admin/sites/2/pages/2/null"):
actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.3) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.3) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.3) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.3) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.3) lib/rails/engine.rb:511:in `call'
railties (4.0.3) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/Users/bam/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/Users/bam/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/Users/bam/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
我的Gemfile的相关宝石(我没有添加imagemagick到Gemfile,虽然我已经安装了它。)
ruby '2.0.0'
gem 'rails', '4.0.3'
gem "paperclip", "~> 4.3.0"
gem 'comfortable_mexican_sofa', '~> 1.12.0'
gem 'kaminari'
配置/环境/发育
# Per https://github.com/thoughtbot/paperclip
Paperclip.options[:command_path] = "/usr/bin/"
路由
comfy_route :cms_admin, :path => '/admin'
# Make sure this routeset is defined last
comfy_route :cms, :path => '/', :sitemap => false
配置/初始化/ paperclip.rb
Paperclip.options[:command_path] = "/usr/bin/"
当我上传文件并且成功时,这是服务器日志的前两行,其中差异发生在第2行。
Started POST "/admin/sites/2/files?ajax=true" for 127.0.0.1 at 2015-09-22 01:48:10 -0400
Processing by Comfy::Admin::Cms::FilesController#create as HTML
随意检查回购我不确定如何演示Redactor添加的文件。 https://github.com/jpbamberg1993/aqqaluk它是“redactor”的分支。
毫不犹豫地批评这篇文章是我的第一篇。
谢谢
答案 0 :(得分:0)
事实证明,舒适墨西哥沙发的新版本配备了redactor。基于我们的Ruby版本,它默认为旧版本。升级gemset解决了这个问题。 https://github.com/comfy/comfortable-mexican-sofa/tree/v1.12.6
向我呈现的另一个选择是“您可以在管理员的 Files 部分上传图像,然后在默认页面编辑器中查看图像。上传后图片,CMS在您的编辑器右侧添加了“上传文件”模块,您可以在其中复制并粘贴图片网址以创建<image>
代码。“埃德托罗