# In\_place\_rich\_editor method?

**URL:** <https://www.ruby-forum.com/t/in-place-rich-editor-method/159406>\
**Category:** Rails\
**Created:** [February 4, 2009, 9:19am UTC](https://www.ruby-forum.com/t/in-place-rich-editor-method/159406 "2009-02-04T09:19:43Z")\
**Posts on this page:** 4\
**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, 9:19am UTC](https://www.ruby-forum.com/t/in-place-rich-editor-method/159406/1 "2009-02-04T09:19:43Z")

</div>

For someone i need to fix a bug into an CMS with in place form editing.  
Normally i used the in place form described in the rails recipes recipe  
1.

But in this project someone used antother method called  
in\_place\_rich\_editor  
The method works correctly until i put the save button.  
There is no saving.

in my view

\<%= in\_place\_rich\_editor( @edit.name,  
:url =\> { :action =\> :save\_editable, :id =\> @edit.id },  
:rows =\> “5”, :cols =\> “5”)  
%\>

In the application\_helper.rb

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

```

Is there somebody that knows this type of in place editing?

---

<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, 10:58am UTC](https://www.ruby-forum.com/t/in-place-rich-editor-method/159406/2 "2009-02-04T10:58:19Z")

</div>

Define js InpPlaceRichEditor?

Blog: [http://random8.zenunit.com/](http://random8.zenunit.com/)  
Learn rails: [http://sensei.zenunit.com/](http://sensei.zenunit.com/)

On 04/02/2009, at 7:19 PM, GA Gorter \<rails-mailing-list@andreas-

---

<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, 1:46pm UTC](https://www.ruby-forum.com/t/in-place-rich-editor-method/159406/3 "2009-02-04T13:46:35Z")

</div>

I only get a normal text area.  
And when i click on save nothing happen.

---

<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, 4:32pm UTC](https://www.ruby-forum.com/t/in-place-rich-editor-method/159406/4 "2009-02-04T16:32:19Z")

</div>

This App uses ThinMCE 3.0 but the controls.js doesn’t support some  
functions.

tinyMCE.addMCEControl is not a function.

I put this into the controls.js  
tinyMCE.execCommand(“mceAddControl”, true, “TEXT\_AREA\_ID”);

No result att all but the error has gone, now i have the error

tinyMCE.gtContent is not a function

Is there somewhere an older thinMCE version so i can easily solvve this.
