Forum: Ruby on Rails Rich editor.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
GG9 R. (Guest)
on 2009-02-04 19:16
I have a script with a tinymce editor included.
But the editor doesn't work at all.
Can somebody explain what is wrong.

In the application_helper

   def in_place_rich_editor(field_id, options = {})
        function =  "new Ajax.InPlaceRichEditor("
        function << "'#{field_id}', "
        function << "'#{url_for(options[:url])}'"

        js_options = {}
        js_options['cancelText'] = %('#{options[:cancel_text]}') if
        js_options['okText'] = %('#{options[:save_text]}') if
        js_options['loadingText'] = %('#{options[:loading_text]}') if
        js_options['rows'] = options[:rows] if options[:rows]
        js_options['cols'] = options[:cols] if options[:cols]
        js_options['size'] = options[:size] if options[:size]
        js_options['size'] = options[:class] if options[:class]
        js_options['externalControl'] =
"'#{options[:external_control]}'" if options[:external_control]
        js_options['loadTextURL'] =
"'#{url_for(options[:load_text_url])}'" if options[:load_text_url]
        js_options['ajaxOptions'] = options[:options] if
        js_options['evalScripts'] = options[:script] if options[:script]
        js_options['callback']   = "function(form) { return
#{options[:with]} }" if options[:with]
        function << (', ' + options_for_javascript(js_options)) unless

        function << ')'


In the controller

    def save_editable
         flash[:notice] = "Je bent aangemeld."
     @editables = Page.find(:first, :conditions => "name =
     @editable = @editables.find(params[:id])
     previous_content = @editable.html
     @editable.html = params[:value]
     @editable.html = previous_content unless
     render :partial =>

In the view

   <%= in_place_rich_editor(,
     :url => { :action => :save_editable, :id => },
     :rows => "5", :cols => "5")

But i get only a normal clickeble text area and when i tried to save the
script nothing happened.

In the errorconsole of firefox i got tinyMCEaddMCEControl is not a

I tried to use an older version of tinymce but no difference att all.
This topic is locked and can not be replied to.