Skip to content

FCKeditor Plugin 0.5.1 Released

Thanks to George Chatzigeorgiou there is now a version of the FCKeditor plugin that works with Rails 2.1. I have put the packages on Ruby Forge and updated the repository. If you are interested as to what the issue was check out George’s comments on the previous post.

31 Comments

  1. Harald wrote:

    Flash Upload is not working for me.

    Hi, i’am using Rails 2.1 and your FCKEditor Plugin 0.5.1. If i try to upload a flash movie it fails with a javascript popup "Invalid file". On the console i can see an error: "application/x-shockwave-flash2-preview is invalid MIME type". The same error happens in your demo. But on this site it is working: http://www.fckeditor.net/demo
    What is the problem with this MIME-Typ. If downloaded a few *.swf files an they all are reported as xxx-flash2-preview
    Thank!

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  2. @Harald if you look in the fckeditor_controller at the top the mime type for flash is "application/x-shockwave-flash" I guess that needs expanding. But, for now you can just add your own mime types there.

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  3. harald wrote:

    Grr, i already tried that and it didn’t work. But now it is :-) . I guess i forgot to restart the server last time.

    Thank you

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  4. Freddy Andersen wrote:

    Great work guys!

    Just updated the plugin from 0.5.0 to 0.5.1 and I can now upload images to my rails 2.1 project.

    Thanks for you time Scott and George..

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  5. Glad I could help.
    You should thank Scott. He did all the work :)

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  6. Wouter wrote:

    Hi,

    The plugin is really great but I’m wondering :
    Is it possible to also delete files when you upload files? (like in the pro version of tinymce)

    Thanks:)

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  7. David wrote:

    The ‘Link File Upload’ does not work for me (Rails 2.1 / FCKEditor 0.5.1). The file is uploaded, but the dialogue seems not to get a proper response from the server. When clicking on "OK", a javascript popup says "Please type the link URL". There is no javascript / ruby error. Here’s the console output :
    <code>
    Processing FckeditorController#upload (for 127.0.0.1 at 2008-07-14 16:59:31) [POST]
    Session ID: BAh7BzoMY3NyZl9pZCIlMGNkZjkxMTQ0ZmVkZTUzNDA5MmQyYmY1MDA2M2Ri
    MWQiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh
    c2h7AAY6CkB1c2VkewA=–ec88edb69e66e2f780a63dfe6bdb57b219fa5d49
    Parameters: {"action"=>"upload", "controller"=>"fckeditor", "NewFile"=>#<File:/tmp/CGI.29919.2>}
    Completed in 0.00141 (710 reqs/sec) | Rendering: 0.00037 (26%) | DB: 0.00000 (0%) | 200 OK [http://localhost/fckeditor/upload]
    </code>

    @Wouter : you can’t delete an uploaded file with FCKEditor. You need to use the <a href="http:://www.ckfinder.com/">CKFinder extension</a>. Unfortunatly, the server-side API is only implemented for PHP / ColdFusion / ASP.

    I you do see a ruby/rails implementation, let me know… ;-)
    davidonlaptop [at a website named] gmail [dot] com

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  8. Dorian wrote:

    Hi there, thanks for a great plugin. I have it all working nicely except I’m a bit stuck using it in form_for with nested resources. I have the following:
    <code>
    <% form_for([@client, @campaign], :html => { :multipart => true }) do |f| %>

    <% @campaign.video_jams.each do |video| %>
    <% fields_for "video_jams[#{video.id}]", video do |v| %>
    <%= fckeditor_textarea("video", "body", :toolbarSet => "Basic", :width => "400px", :height => "200px") %>
    <% end %>
    <% end %>

    <% end %>
    </code>
    in the editor call I currently have ‘video’ which makes the editor bar only appear for the first object in the loop. I know that ‘video’ is not the right thing to use.

    Is this even possible? Any help much appreciated!

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  9. I’m allergic to SVN so I cloned the repo and placed it up on GitHub at this address…
    http://github.com/bilson/fckeditor/tree/master

    Great plugin!

    Scott, if you want to get your own GitHub account, you can host public repos for free. In that case I’d be happy to take down my Github fckeditor repo to eliminate confusion.

    Best Regards,
    David Baldwin

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  10. @David, ok cool. When I get round to moving to GitHub I will let you know.

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  11. James Bosworth wrote:

    Great plug in, I really like it. I do however have one problem, I can not get the spell checker to work on my live server although it seems to work fine on my local machine. Even when their are deliberate mistakes a pop up appears saying spell check complete. I have upgraded from an earlier version of the plug in using subversion then the rake command to install it. can you suggest any reason for this? The problem server is running debian and the app is written in rails 2.0.2

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  12. Hi James, nothing springs to mind. I would start out by checking the aspell install on the debian box.

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  13. James Bosworth wrote:

    Nice one. Thanks a lot. I didn’t have aspell installed at all. I installed it and everything is working perfectly.

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  14. Cheng wrote:

    Hi James: Great thanks for your job, I started to use this plugin in my Rails project. One question: does the file/image upload work in your plug-in? What config should I make?

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  15. Matt wrote:

    Thanks for putting this together! Big time saver.

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  16. As @Matt said above.. what a great time saver! Awesome!
    Just one thing, when I want to insert a image, I get the "Unknown error creating folder" when clicking on the Find on the server button, so, my question is: IS this error common? there a forum or a guide to config the plugin ??
    Cause your plugin make things very simples, but in mysterious ways :P

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  17. Santosh Verma wrote:

    I am unable to connect to svn://rubyforge.org//var/svn/fckeditorp/trunk/fckeditor neither from command prompt, nor from svn client.

    is the site down?

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  18. Dabla wrote:

    Great work on this plugin which I was already using, still I have found a small issue for Rails 1.2.x users just like me :) It can be easily solved, that’s why I want to share. When installing the plugin, I receive the following error:

    uninitialized constant ActionView::Helpers::SanitizeHelper

    Patch the include in the fckeditor_controller as follow and the plugin will be 1.2.x AND 2.x compliant:

    begin
    include ActionView::Helpers::SanitizeHelper
    rescue
    include ActionView::Helpers::TextHelper
    end

    Hope this helps.

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  19. johny wrote:

    I have fckeditor plugins installed on my RoR application it works great my problem is on the show.rhtml it display the source code instead an image or the content.I want to see the image with context on http://localhost:3000/users/4 not the html source code

    os windows xp
    Name: naruto image
    Body: <p><img alt="" style="width: 282px; height: 233px;" src="/uploads/Image/naruto.jpg" />test page</p> <p>I want to display the image and text on this page not the html source code</p>

    show.rhtml
    <p>
    <b>Name:</b>
    <%=h @user.name %>
    </p>

    <p>
    <b>Body:</b>
    <%=h @user.body %>
    </p>
    new.rhtml
    <% form_for(@user) do |f| %>
    <%= f.error_messages %>

    <p>
    <%= f.label :name %><br />
    <%= f.text_field :name %>
    </p>
    <p>
    <%= f.label :body %><br />

    <%= fckeditor_textarea("user", "body", :toolbarSet => ‘Simple’,
    :width => ‘100%’, :height => ‘400px’) %>

    </p>
    <p>
    <%= f.submit "Create" %>
    </p>
    <% end %>

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  20. johny wrote:

    Hi guys just ignore what I posted.I only forgot to remove the h on my show.rhtml.

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  21. Keith wrote:

    I’m getting an Action Controller typeError of "can’t convert Hash into String" when I use
    <%= javascript_include_tag :fckeditor %>

    Does anyone know what might be causing this?

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  22. Michael wrote:

    Any plans to upload a release for Rails 2.2.2?

    I found that the following lines needed changing to use ActionController::Base.relative_url_root instead of request.relative_url_root:

    ActionController::Base.relative_url_root

    app/controllers/fckeditor_controller.rb
    136| uploaded = request.relative_url_root.to_s+"#{UPLOADED}/#{params[:Type]}"

    lib/fckeditor.rb
    38| js_path = "#{request.relative_url_root}/javascripts"

    Came right up and started working after these changes.

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  23. Raghavendra Shet wrote:

    Hello Scott,

    I am interested to know about the licensing information about FCk Editor Version 0.4.3.

    I am using this in one of my application, please respond me with the license information , I was not able to get the information in readme file.

    email:- raghavendra_shet@persistent.co.in

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  24. f3ex wrote:

    Dabla, thanks

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  25. There is an updated version for Rails 2.2.2 at http://github.com/gramos/easy-fckeditor/tree/master

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  26. Juan Carlos wrote:

    Hi, first of all, congratulations and thanks a lot for this job.
    I’m a new rails user… I install the plugin in my project but when i make a test, the follow error lines are shown:

    (eval):1:in `fckeditor_element_id’: Called id for nil, which would mistakenly be 4 — if you really wanted the id of nil, use object_id

    After install the plugin is needed something else to make it works.

    Thank you for your help.

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  27. Juan Carlos wrote:

    Well… now the editor try to appear in the site, but the following error appears:<br><pre>No route matches "(path/edited)/public/javascripts/fckeditor/editor/fckeditor.html" with {:method=>:get}</pre>

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  28. sledzx wrote:

    Hi
    when I want to insert a image, I get the "Unknown error creating folder"
    any solution to fix this problem?

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  29. Bill D wrote:

    For those getting the "Unknown error creating folder" problem, I found a fix in this post: http://davidebenini.it/2009/03/23/patches-for-the-easy-fckeditor-rails-plugin/

    I am using Rails 2.3.2 and doing the following worked for me.

    In the supporting Ruby code in the fckeditor plugin directory, change all occurrences of ‘request.relative_url_root’ with ‘ActionController::Base.relative_url_root’. There are only two of that I know:

    vendor/plugins/fckeditor/lib/fckeditor.rb – line 38
    vendor/plugins/fckeditor/app/controllers/fckeditor_controller.rb – line 136

    Making this change fixed the problem for me.

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  30. sergio_101 wrote:

    okay, i used bill d’s fixes, and everything worked GREAT! after a few hours, it stopped working altogether..

    this is the error (from firebug) that i am getting..

    uncaught exception: Access to restricted URI denied (NS_ERROR_DOM_BAD_URI)
    [Break on this error] oXmlHttp.open( "GET", urlToCall, bAsync ) ;

    has anyone else dealt with this?

    thanks!

    Saturday, June 21, 2008 at 10:04 pm | Permalink
  31. Dabla wrote:

    I also found & fixed those as follow:

    In fckeditor.rb (line 38):

    js_path = "#{request.class.respond_to?(:relative_url_root) ? request.relative_url_root : ActionController::Base.relative_url_root}/javascripts"

    In fckeditor_controller.rb (line 136):

    uploaded = "#{(request.class.respond_to?(:relative_url_root) ? request.relative_url_root : ActionController::Base.relative_url_root)}#{UPLOADED}/#{params[:Type]}"

    Saturday, June 21, 2008 at 10:04 pm | Permalink