FCKeditor 0.4.0 Released
December 3rd, 2006
I released a new version of the FCKeditor plugin today. It contains a couple of changes to the controller to fix a potential security issue and also a remote_form_for helper so that now you can do this:
<% fckeditor_remote_form_for :note,
:url => @options.merge(:controller => 'notes'),
:editors => { :note => ['text'] } do |f| %>
<%= fckeditor_textarea( "note", "text", :ajax => true )
<% end %>
You still need to use the original fckeditor_textarea call as as of yet there is no f.fckeditor_textarea method.
I am currently trying to add a check for IsDirty to prevent accidental unloading of the editor and also looking at using the FCKeditor_IsCompatibleBrowser() function to degrade gracefully.
N.B If you are upgrading you will need to delete the public/javascripts/fckeditor directory before reinstalling…
November 25th, 2007 at 11:18 PM Wonderful tool--thank you! You have some typos on this post (here is a corrected version): <% fckeditor_remote_form_for :note, :url => @options.merge(:controller => 'notes'), :editors => { :note => ['text'] } do |f| %> <%= fckeditor_textarea( "note", "text", :ajax => true ) %> <% end %> Can't seem to get AjaxScaffold and FCKeditor to work together like your demos (individually they work fine). When I use FCKEditor textarea decl. inside of the _form.rhtml, it won't save any changes. Using the :ajax=>true option makes it *delete* all text! Any help would be greatly appreciated. Again, many thanks.
November 25th, 2007 at 11:18 PM I was unable to get link/upload to work on 0.3.2 or 0.4.0; upload worked but the newly uploaded file's URL was not entered on the 'Link Info' tab... Fixed in fckeditor_controller.rb by changing this: render :text => %Q'
November 25th, 2007 at 11:18 PM Hi Great Plugin, But unfortunately I am unable to upload an image (403 error)!! However I can create a directory. Any clues?
November 25th, 2007 at 11:18 PM @Kevin, thanks for pointing that out I have updated the post. As for the Scaffold and FCK, if you email me I will send the demo code to you and you can see how I did it, if that helps? @Jon, I'll check that out, thanks for the feedback. @Michael, thats a bit odd. Is that from the Image Properties page or the Resource Browser? Cheers Scott.
November 25th, 2007 at 11:18 PM From the resource browser. BTW: I am using Mongrel
November 25th, 2007 at 11:18 PM In the log file I am also getting the next messages: # FckeditorController: missing default helper path fckeditor_helper # ctionController::RoutingError (Recognition failed for "/fckblank.html"):
November 25th, 2007 at 11:18 PM Another question: how can I specify a skin?
November 25th, 2007 at 11:18 PM Hi Michael, you can specify a skin in the fckcustom.js file in public/javascripts/ change this line: FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/silver/' The helper message is harmless, I meant to do something about that (forgot). I will take a look at the fckblank.html error. I haven't tested the editor with mongrel, but I have just been sent a demo that uses it so I will set a test up. Cheers Scott.
November 25th, 2007 at 11:18 PM Thanks Scott, I look forward if you could find a hint to solve my upload problem. Cheers, Michel Btw (my name uses the french spelling :-)
November 25th, 2007 at 11:18 PM I had problems with the textarea not displaying in firefox while everything perfectly works in IE. I thought it was a javascript error. Nearly drove me mad. However I fixed it by putting in a height and width attribute in the fckeditor_textarea call. Putting in :width => '400', :height => '200' for example shows the textarea box. Just make it bigger or smaller on what you need with the fckeditor. Hey scott, thanks again for the awesome plugin James
November 25th, 2007 at 11:18 PM Actually scratch that, I dont think that was the problem. In the FCKConfig.ToolbarSets part of your configuration, either being fckcustom.js or fckconfig.js.. If you get rid of ['style'] it might work for you.. That was the one value that was causing my textarea not to be generated.
November 25th, 2007 at 11:18 PM Hi James, Thanks for that, a few people have had issues with the editor not being displayed in Firefox. I personally haven't had this issue but hopefully one of these solutions will work for people. Cheers Scott.
November 25th, 2007 at 11:18 PM No display problems here with Firefox 2.x However I am still unable to upload images using Mongrel :-(
November 25th, 2007 at 11:18 PM Michel, At one stage I could upload images in IE, but now I am getting an XML error. I am trying to figure out what is going wrong here. James
November 25th, 2007 at 11:18 PM Wow, I don't know why, but now I am able to upload images, for the first time.... It always bothers me do if stuff is suddenly working without knowing its cause and remedy.... Anyway its working! Thats better then not! Cheers, Michel
November 25th, 2007 at 11:18 PM @ Michel, I'm not a big fan of things fixing themselves either really. But, as I didn't get an answer for you in this case I'll take it...... Glad you got in working. @James, sorry to hear you are having issues too. Let me know if it continues. Cheers Scott
November 25th, 2007 at 11:18 PM I'm trying to use AjaxScaffold Generator with remote_upload and fckeditor plugins, but somethig happen that not let me use both plugins with Generator, I search the code for a while, and found that is somethig related to the remote upload iframe, respond_to_parent plugin (used with remote_upload). This are the facts: - If no substitution of the form_remote_tag to form_remote_upload_tag is made, the FCKEditor area is shown. - If the above substitution is made, the upload works, but no wysiwyg area is show, and any change in the textarea created by FCKEditor is not updated to the database, instead the column is updated to blank. I have 2 questions: 1. The plug-in is ready to work with remote_upload, file_colum, and fckeditor at the same time ? 2. Someone had make all these plugins work together with the ajaxscaffold plugin or generator ? If so, let me know any advice. THANKS in advance
November 25th, 2007 at 11:18 PM Hi LFung, unfortunately I myself haven't tried to use all of these together so I can't really help you there. If I get around it and find a solution at any point (or anyone else does and tells me....) I will put u pa post about it. Cheers Scott.
November 25th, 2007 at 11:18 PM I met the some problem as Jon did. After i copied Jon's modification (please note that there are two 'script's been omited.) and changed the ”#{@new_file.original_filename}" to "/uploads/Image/#{@new_file.original_filename}" (/uploads/Image/ is where I put my images in), it worked fine.
November 25th, 2007 at 11:18 PM Hi Zhan, thanks for letting me know. I'll have to have another look at it. Cheers Scott.
November 25th, 2007 at 11:18 PM Lazy people like me will get nailed by copying and pasting from the 'Usage' part of your README file: This one-liner is missing a ' after 'Simple' and a ) at the end of the statement: <%= fckeditor_textarea("object", "field", :toolbarSet => 'Simple, :width => '100%', :height => '200px' %>
November 25th, 2007 at 11:18 PM This plugin is not working with Rails 1.2.1. I have the javascript include in there, but it is throwing an error: undefined method `fckeditor_div_id' for #<#<class:0x62079ec>:0x62079c4> Anybody run into a similar problem or have a fix for 1.2.1?
November 25th, 2007 at 11:18 PM Hi Patrick, it works fine for me with 1.2.1. I think you must have a different issue. That method is defined in the ruby code not the javascript. If you want to email me your code I can probably see whats up. Cheers Scott
November 25th, 2007 at 11:18 PM Thanks for the reply Scott. It does work after all. What I had to do to get it to work was restart the server and clear my cache. I should have done this by default before posting.
November 25th, 2007 at 11:18 PM Hi Scott, I have an issue about image upload. When I try to upload to the server, this error occurs. "Error on file upload. Error number: 403" Any suggestion? Thanks!
November 25th, 2007 at 11:18 PM I'm having the image upload problem as well, it gives me back a 403 error when trying to upload. I'm using Rails 1.2.2. I've tried it with both Webrick and Mongrel but no luck. I'm on a Mac using Firefox. I'll test with some other browsers and see if I can narrow it down any.
November 25th, 2007 at 11:18 PM If you are getting the 403 error when trying to upload an image I found where it is bombing out and a workaround. If you go into the plugin and edit the file: app/controller/fckeditor_controller.rb The error comes from the check_file method. Edit the following line: unless "#{file.class}" == "Tempfile" And change it to this: unless "#{file.class}" == "Tempfile" || "#{file.class}" == "StringIO" This worked around it for me as the file.class returned as a StringIO instead of a Tempfile. Everything worked fine with this change and the images made it up to where they were supposed to go. Hope this helps anyone getting stuck with this.
November 25th, 2007 at 11:18 PM Hi Chris, thanks for posting your fix in the appropriate places, I'll take a proper look as soon as.... Thanks again Scott
November 25th, 2007 at 11:18 PM Hi Scott, I have downloaded file fckeditor_plugin-0.4.0.tgz, unpacked and put him in directory 'vendor'. Then I'm renamed a folder 'fckeditor_plugin-0.4.0' in 'fckeditor'. But, if I do command 'rake fckeditor:install', I receive a error:
November 25th, 2007 at 11:18 PM I am having the same problem as x0n. Does anyone have a solution to the problem?
November 25th, 2007 at 11:18 PM Make that at least three people getting the "uninitialized constant ActionView" message. FIY, Rails 1.2.3, Ruby 1.8.4, fckeditor 0.4.0.
November 25th, 2007 at 11:18 PM I am recieving this as well... rake fckeditor:install --trace (in /Users/dballenger/Xcode/fs-1.0) ** Invoke fckeditor:install (first_time) ** Execute fckeditor:install rake aborted! uninitialized constant ActionView /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1981:in `const_missing' /Users/dballenger/Xcode/fs-1.0/config/../vendor/plugins/fckeditor/lib/fckeditor.rb:75 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /Users/dballenger/Xcode/fs-1.0/config/../vendor/plugins/fckeditor/tasks/fckeditor_tasks.rake:12 /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `call' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:369:in `invoke' /usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/bin/rake:7 /usr/local/bin/rake:18:in `load' /usr/local/bin/rake:18
November 25th, 2007 at 11:18 PM Same problem here! Any solution yet?
November 25th, 2007 at 11:18 PM Yet another person with the uninitialized constant ActionView while doing rake fckeditor:install. Rails 1.2.3, Ruby 1.8.6
November 25th, 2007 at 11:18 PM I've discovered a workaround for the uninitialized constant problem. Go into script/console and manually run the FckeditorFileUtils.destroy_and_install command. It looks like that copies all the necessary files. I'd also like to make a suggestion for a fckeditor_textarea_tag helper for use with non-model fields.
November 25th, 2007 at 11:18 PM There is now a release (0.4.1) up with a fix, sorry for the delay. Cheers Scott
August 12th, 2008 at 09:31 AM Hi Scott, i am using multiple fckeditor textarea in partials with javascripts. it is giving me an error: ActionController::RoutingError (No route matches "/Javascript/Common.js" with {:method=>:get}): i am using following code: <head> <%= javascript_include_tag "FCKEditor/fckeditor.js" %> </head> and in html form
August 12th, 2008 at 09:35 AM Hi Scott, i am using multiple fckeditor textarea in partials with javascripts. it is giving me an error: ActionController::RoutingError (No route matches "/Javascript/Common.js" with {:method=>:get}): i am using following code: <head> <%= javascript_include_tag "FCKEditor/fckeditor.js" %> </head> and in html form