kreativgebiet / rich

:money_with_wings: An opinionated CKEditor editor for Rails with flexible image uploads
MIT License
418 stars 238 forks source link

Route not found on upload #19

Closed chrsgrrtt closed 11 years ago

chrsgrrtt commented 12 years ago

So I've installed the Gem and am mounting the engine, the WYSIWYG side works perfectly (with ActiveAdmin). However, when trying to upload from the file dialogue which all loads fine, I'm getting a routing error:

ActionController::RoutingError (No route matches [POST] "/rich/files/authenticity_token=bnRKfskN8ZdtOTNAWoc0reESW7wpeAEd9gBDTTAneYM=&simplified_type=image&scoped=false&scope_type=undefined&scope_id=undefined&qqfile=02.jpg")

Is anyone else experiencing this?

bastiaanterhorst commented 12 years ago

Hi, Could you provide some more information? Like Ruby/Rails/AA version and anything else that might be relevant?

backwardm commented 12 years ago

I too am seeing this error. The Rich editing side of things works really well inside Active Admin (thanks!) but uploading a new image through the inbuilt file manager fails with the following error:

ActionController::RoutingError (No route matches [POST] "/rich/files/authenticity_token=IfNmb4pdK4mcvD9FMpMm17CQP5Fqb0niDa30XKeLgNA=&simplified_type=image&scoped=false&scope_type=undefined&scope_id=undefined&qqfile=image.jpg"):

I am using:

Ruby on Rails version 3.1.3 Ruby ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux] A svelte gemset:

gem 'rails', '3.1.3'
gem 'mysql2'
gem 'aws-sdk'
gem 'paperclip', '2.7'
gem 'sass-rails', '~> 3.1.5'
gem 'activeadmin', :git => 'git://github.com/mhuggins/active_admin.git'
gem 'acts_as_list'
gem 'acts_as_commentable'
gem 'thinking-sphinx'
gem 'rich'
gem 'will_paginate', '> 3.0'

My rake routes has this line at the end:

rich            /rich                                             {:to=>Rich::Engine}

To be clear, I'm invoking the Rich file manager from within an Active Admin view by clicking on the new image icon, then clicking the plus icon, choosing a file from the file system and uploading. If I feed the file manager a large image, I can see the progress bar moving, then the error appear in the log files. Nothing is written to the database table and this happens in both development and production environments.

I'll be glad to help figure out what's going on, but I'm not sure how to work with Engines like this.

bastiaanterhorst commented 12 years ago

@backwardm did the change you comitted to your fork fix the issue?

backwardm commented 12 years ago

It didn't, but I thought I was onto something. I've been trying a few different things and will continue to try to solve the issue today. My hunch is that Active Admin is running over the routes somehow, so next I'm going to try a non-active admin environment to see if it works.

bastiaanterhorst commented 12 years ago

Fyi, I tried rich with latest rails and AA from master (git), and it worked fine. I have the feeling it might be a change in rails between 3.1 and 3.2, but I haven't had the time to investigate.

Bastiaan Terhorst +31655535395

On Thursday 24 May 2012 at 18:00, Michael Davie wrote:

It didn't, but I thought I was onto something. I've been trying a few different things and will continue to try to solve the issue today. My hunch is that Active Admin is running over the routes somehow, so next I'm going to try a non-active admin environment to see if it works.


Reply to this email directly or view it on GitHub: https://github.com/bastiaanterhorst/rich/issues/19#issuecomment-5910176

backwardm commented 12 years ago

Thanks for your note bastiaanterhorst. I also updated my app to use Rails 3.2.0 and am now able to upload and use images inside Active Admin. So my hunch was incorrect about it being Active Admin's fault, but I'm glad to have it resolved one way or another.

Thanks for making a really nice tool like this. I appreciate it.