# In\_place\_editor on Rails 1.2.1 seems to be broken

**URL:** <https://www.ruby-forum.com/t/in-place-editor-on-rails-1-2-1-seems-to-be-broken/84320>\
**Category:** Rails\
**Created:** [February 3, 2007, 1:51am UTC](https://www.ruby-forum.com/t/in-place-editor-on-rails-1-2-1-seems-to-be-broken/84320 "2007-02-03T01:51:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rolando\_Lora](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/49beb7/32.png) [@Rolando\_Lora](https://www.ruby-forum.com/u/Rolando_Lora)\
**Post date:** [February 3, 2007, 1:51am UTC](https://www.ruby-forum.com/t/in-place-editor-on-rails-1-2-1-seems-to-be-broken/84320/1 "2007-02-03T01:51:44Z")

</div>

The upgrade to the last version of rails (1.2.1) and prototype (1.5.0)  
seems to introduce a bug in the "in\_place\_editor’.

Below a piece of code from an application that was on production:

=== VIEW ===

\<%= in\_place\_editor(  
“salary\_benefit\_earnings\_percentage\_#{ salary\_benefit.id }”,  
{ :size =\> 5,  
:url =\> { :action =\> :update\_benefit,  
:attribute =\> “earnings\_percentage”,  
:old\_value =\> salary\_benefit.earnings\_percentage,  
:id =\> salary\_benefit.id } } ) %\>

=== HTML SRC ===

=== EVALUATION OF PARAMS IN THE CONTROLLER ===  
params

{“amp;old\_value”=\>“0.0”,  
“action”=\>“update\_deduction”,  
“id”=\>“43”,  
“value”=\>“5”,  
“controller”=\>“human\_resources/personnel\_members”,  
“attribute”=\>“fixed\_number\_of\_hours”}

The URL in the html src has an & escaped, and one param has ‘amp;’  
prefixed to it. I tried with multiple interfaces where the  
in\_place\_editor has a wrong behavior.

Is someone else having similar problems? Could it be a bug in the  
in\_place\_editor or in the routing module?

---

<div class="post-metadata">

**Author:** ![Rolando\_Lora](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/49beb7/32.png) [@Rolando\_Lora](https://www.ruby-forum.com/u/Rolando_Lora)\
**Post date:** [April 4, 2007, 1:46pm UTC](https://www.ruby-forum.com/t/in-place-editor-on-rails-1-2-1-seems-to-be-broken/84320/2 "2007-04-04T13:46:26Z")

</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', :path =\> file\_path }), :load\_text\_url =\> url\_for({ :action =\> 'file\_contents', :path =\> file\_path }), %\>

Before I click the div, contents of the file are rendered correctly.  
But when I click the div, the in\_place\_editor does some escaping…

\< (Less than) is escaped and becomes \<

> (Greater than) is escaped and becomes \>  
> & (Ampersand) is escaped and becomes &  
> " (Double quote) is escaped and becomes "

All other special characters I tested ( % @ = \* § / \ ’ and some  
German specific characters…) work fine and do not get escaped.  
So ERB::Util.h probably is not the reason for this behaviour.

When I hit cancel, all escapes made to the file are undone.  
But when I save the form, the file now includes all those escapes.  
If I edit it again, those escapes now get escaped themselves ( \<  
becomes &lt; )…

Also all slashes in the URLs for :url and :load\_text\_url get escaped  
with %2F.  
However WEBrick doesn’t care and serves those URLs properly.

Is this a known bug?
