Forum: Ruby on Rails Uploads with FCKEditor

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
520b6d013b68d3e2b4418a19431e5b1d?d=identicon&s=25 Daniel Drehmer (Guest)
on 2009-04-03 01:25
(Received via mailing list)
Hello everyone.

Since I've found very poor documentation about the rails FCKEditor
plug-in and Easy-FCKEditor (which is a fork of the very same plug-in),
I decided to bother you with my noobish questions.

I have this weird sensation that the image-uploading feature of
FCKEditor isn't supposed to work magically, without some sort of
server side preparation, but I have no idea about what to do to make
it work.

Weirdly, when I try to upload an image it gives a message saying that
the upload was successful, but fails to show the image (and the path
that it inserts in the editor's 'text area' points to an unexistent
uploads/images/ directory. I created this directory inside public, and
I still can't make it upload the image).

Also, when I try to open the file browser it shows this message:
"unknown error creating folder".

I'm kind of used to the abstraction level provided by rails and other
upload plug-ins such as attachment_fu, so i know very little about how
to deal with this.

Any help will be apreciated.

Thanks

(I'm trying it on my development enviroment, which uses rails 2.2.2,
but I intent to use it in my mor.ph account when in production.)
2505b282d57c29be797dc35b245adb4c?d=identicon&s=25 Philip Hallstrom (Guest)
on 2009-04-03 04:57
(Received via mailing list)
It works.  The error messages it spits back can be a little vague.

I found that I needed to change the following (my version is first)
due to the new changes in Rails/rack/etc.

155c142,143
<     unless ['ActionController::UploadedStringIO',
'ActionController::UploadedTempfile', 'Tempfile', 'TempFile',
'StringIO'].include?(file.class.to_s)
---
 >     # RAILS_DEFAULT_LOGGER.info "CLASS OF UPLOAD OBJECT:
#{file.class}"
 >     unless "#{file.class}" == "Tempfile" || "StringIO"
110e527af05961700d9e39285d043b62?d=identicon&s=25 Gianluca Tessarolo (Guest)
on 2009-04-03 09:06
(Received via mailing list)
I used fckeditor for some projects but I find that TinyMCE editor and
rails plugin is better, for all my new rails projects now I'm using this
plugin:

script/plugin install git://github.com/kete/tiny_mce.git

The upload mechanism does'nt exist but if you prepare a simple
controller/view for your upload system, the integration is really
simple...

For example with this simple javascript included into your page you can
control image / link / multimedia upload, in my case I have:

    <script type='text/javascript'>
      var returnURL = "";
      var browserWindow;
      var browserFieldName;
      function fileBrowserCallBack( field_name, url, type, win ){
        if (type == "file") {
          browserUrl = "/admin/files";
        else if (type == "media") {
          browserUrl = "/admin/medias";
        } else {
          browserUrl = "/admin/images";
        }
        window.open(browserUrl, '',
'width=800,height=400,scrollbars=yes');
        browserWindow = win;
        browserFieldName = field_name;
      }

      function browserReturn(url) {
        browserWindow.document.forms[0].elements[browserFieldName].value
= url;
      }
    </script>
520b6d013b68d3e2b4418a19431e5b1d?d=identicon&s=25 Daniel Drehmer (Guest)
on 2009-04-03 10:08
(Received via mailing list)
Thank you for the feedback. I'll certainly try tinymce in a future
project.

It turn's out someone on the net has figured out how to make easy-
fckeditor work properly with rails 2.2.2, and with his advice, now it
works in my project too.

if anyone is having the same problems I was, just check this page:

http://davidebenini.it/2009/03/23/patches-for-the-...

On 3 abr, 04:06, Gianluca Tessarolo
520b6d013b68d3e2b4418a19431e5b1d?d=identicon&s=25 Daniel Drehmer (Guest)
on 2009-04-03 10:09
(Received via mailing list)
Thank you for the feedback. I'll certainly try tinymce in a future
project.
It turns out someone on the net has figured out how to make easy-
fckeditor work properly with rails 2.2.2, and with his advice, now it
works in my project too.
if anyone is having the same problems I was, just check this page:
http://davidebenini.it/2009/03/23/patches-for-the-......

On 3 abr, 04:06, Gianluca Tessarolo
This topic is locked and can not be replied to.