# Re: in\_place\_editor on Rails 1.2.1 seems to be broken

**URL:** <https://www.ruby-forum.com/t/re-in-place-editor-on-rails-1-2-1-seems-to-be-broken/91091>\
**Category:** Ruby\
**Created:** [April 4, 2007, 4:58pm UTC](https://www.ruby-forum.com/t/re-in-place-editor-on-rails-1-2-1-seems-to-be-broken/91091 "2007-04-04T16:58:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tvon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90db22/32.png) [@tvon](https://www.ruby-forum.com/u/tvon)\
**Post date:** [April 4, 2007, 4:58pm UTC](https://www.ruby-forum.com/t/re-in-place-editor-on-rails-1-2-1-seems-to-be-broken/91091/1 "2007-04-04T16:58:22Z")

</div>

I have a similar problem.  
I am using in\_place\_editor with the :load\_text\_url option:

 \<%= h file\_contents %\>
\<%= in\_place\_editor 'editme', :url =\> url\_for({ :action =\> 'save\_file', :path =\> file\_path }), :load\_text\_url =\> url\_for({ :action =\> 'file\_contents', :path =\> file\_path }), :save\_text =\> 'save', :rows =\> 30, :cols =\> 88 %\>

The contents of a file is rendered inside the div.  
Whenever I click it, the in\_place\_editor does some strange escaping to  
the file contents:

\< (less than) becomes \<

> (greater than) becomes \>  
> & (ampersand) becomes &  
> " (double quote) becomes "

At the end of the file, double slashes ( // ) are added.

I tried a couple of other special characters ( \* / \ # ’ @ § ).  
Those do not get escaped…  
If I hit cancel and the form closes, all changes made to \< \> & " are  
cancelled.

Funny thing is when I save the form and reopen it,  
those escapes escape themselves ( \< ==\> &lt; )…

Slashes inside the file\_path also get escaped (%2F).

Regards,  
Tom.

btw:  
I use a JS call to get width/height of the current window  
but I have no idea how to assign those values to :rows/:cols…?

## p.s.: early I answered Rolando’s post using google-groups but that seems to have failed. If anyone gets my post twice I apologize…
