# In\_place\_field\_editor: Must you have an instance variable?

**URL:** <https://www.ruby-forum.com/t/in-place-field-editor-must-you-have-an-instance-variable/109461>\
**Category:** Rails\
**Created:** [July 15, 2007, 8:27am UTC](https://www.ruby-forum.com/t/in-place-field-editor-must-you-have-an-instance-variable/109461 "2007-07-15T08:27:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/bc8723/32.png) [@lee](https://www.ruby-forum.com/u/lee)\
**Post date:** [July 15, 2007, 8:27am UTC](https://www.ruby-forum.com/t/in-place-field-editor-must-you-have-an-instance-variable/109461/1 "2007-07-15T08:27:07Z")

</div>

Hi,

I am trying to implement in\_place\_field\_editor into my UI in a limited  
but useful way.

I want to use in\_place\_field\_editor within a partial that is called  
from a view as shown here:

```
<%= render :partial => "shared/property",
           :collection => @properties,
           :locals => {:member_entity => @logged_in_member_entity}
%>

```

Within the “property” partial, I use the “property” local variable  
(current entry of the :collection).

I should like to use in\_place\_field\_editor to edit the name attribute  
of “property” as shown here:

```
      <%= in_place_editor_field :property, :name, {},

```

{:external\_control =\> “rename\_name\_#{property.id}”, :save\_text =\>  
“update” } %\>

To get this to work I must first do \<% @property = property %\>

Is it possible to avoid this last statement and just to refer to the  
local variable “property” within the in\_place\_editor\_field call?

Thanks.

---

<div class="post-metadata">

**Author:** ![lee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/bc8723/32.png) [@lee](https://www.ruby-forum.com/u/lee)\
**Post date:** [July 15, 2007, 11:30am UTC](https://www.ruby-forum.com/t/in-place-field-editor-must-you-have-an-instance-variable/109461/2 "2007-07-15T11:30:36Z")

</div>

No, not without hacking the in\_place\_editor.

–  
Roderick van Domburg

> **[De domeinnaam Nedforce.nl is te koop.](http://www.nedforce.nl)**
>
> Deze mooie domeinnaam kan al over een paar minuten van jou zijn. Betalen gaat eenvoudig en vertrouwd via iDEAL. Direct na de betaling ontvang je de verhuiscode per e-mail en kun je aan de slag.
