# Rich editor

**URL:** <https://www.ruby-forum.com/t/rich-editor/159453>\
**Category:** Rails\
**Created:** [February 4, 2009, 6:16pm UTC](https://www.ruby-forum.com/t/rich-editor/159453 "2009-02-04T18:16:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gorter9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/839c29/32.png) [@gorter9](https://www.ruby-forum.com/u/gorter9)\
**Post date:** [February 4, 2009, 6:16pm UTC](https://www.ruby-forum.com/t/rich-editor/159453/1 "2009-02-04T18:16:26Z")

</div>

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

```

options[:cancel\_text]  
js\_options[‘okText’] = %(’#{options[:save\_text]}’) if  
options[:save\_text]  
js\_options[‘loadingText’] = %(’#{options[:loading\_text]}’) if  
options[:loading\_text]  
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  
options[:options]  
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  
js\_options.empty?

```
    function << ')'

    javascript_tag(function)
  end

```

In the controller

```
def save_editable
     flash[:notice] = "Je bent aangemeld."
 @editables = Page.find(:first, :conditions => "name =

```

‘Home’").editables  
@editable = @editables.find(params[:id])  
previous\_content = @editable.html  
@editable.html = params[:value]  
@editable.html = previous\_content unless  
@editable.save  
render :partial =\> @editable.name  
end

In the view

\<%= in\_place\_rich\_editor( @edit.name,  
:url =\> { :action =\> :save\_editable, :id =\> @edit.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  
function.

I tried to use an older version of tinymce but no difference att all.
