I have taken an existing site. Integrated a CMS (Comfortable Mexican Sofa). Then installed Redactor. Threw Redactor I have the ability to add content and display it on localhost:3000. I also have the ability to upload Files. I run into a problem using its insert image function in the content box.
My server log:
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'
My Gemfile's relevent Gems (I did not add imagemagick to the Gemfile although I have installed it).
ruby '2.0.0'
gem 'rails', '4.0.3'
gem "paperclip", "~> 4.3.0"
gem 'comfortable_mexican_sofa', '~> 1.12.0'
gem 'kaminari'
config/environments/development
# Per https://github.com/thoughtbot/paperclip
Paperclip.options[:command_path] = "/usr/bin/"
routes
comfy_route :cms_admin, :path => '/admin'
# Make sure this routeset is defined last
comfy_route :cms, :path => '/', :sitemap => false
config/initializers/paperclip.rb
Paperclip.options[:command_path] = "/usr/bin/"
When I file upload and it is successful this is the first two lines of the server log where the difference occurs is on line 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
Feel Free to checkout out the repo I was not sure how do demonstrate the files that Redactor added. https://github.com/jpbamberg1993/aqqaluk the branch it "redactor".
Do not hesitate to critique this post it is my first one.
Thank You
Turns out that the new version of Comfortable Mexican Sofa comes with redactor. Based on our Ruby version it was defaulting to the older version. Upgrading the gemset solved the problem. https://github.com/comfy/comfortable-mexican-sofa/tree/v1.12.6
Another alternative that was presented to me was to "You can upload the image in the Files section of the admin, then refer to the image in your default page editor. After you upload an image, CMS adds an “uploaded files” module to the right of your editor where you can copy-and-paste image URLs to create
<image>tags." Ed Toro