# In\_place\_edit\_field HELP

**URL:** <https://www.ruby-forum.com/t/in-place-edit-field-help/147959>\
**Category:** Rails\
**Created:** [September 7, 2008, 5:31pm UTC](https://www.ruby-forum.com/t/in-place-edit-field-help/147959 "2008-09-07T17:31:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 7, 2008, 5:31pm UTC](https://www.ruby-forum.com/t/in-place-edit-field-help/147959/1 "2008-09-07T17:31:10Z")

</div>

Ok I am on rails 2.1

My show view does not have a"for\_for" but the controller has  
@nocpage = Nocpage.find(params[:id])

and the view for section i am trying to use:

**Companyname:**  
\<%=h @nocpage.companyname %\>

I tried doing:  
\<% @name = @nocpage.companyname %\>  
\<%= in\_place\_editor\_field ‘name’, :companyname %\>

but I keep getting:

undefined method `companyname’ for “att”:String. Why does it keep  
saying undefined method?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 7, 2008, 7:24pm UTC](https://www.ruby-forum.com/t/in-place-edit-field-help/147959/2 "2008-09-07T19:24:50Z")

</div>

On 7 Sep 2008, at 16:30, Me wrote:

> I tried doing:  
> \<% @name = @nocpage.companyname %\>  
> \<%= in\_place\_editor\_field ‘name’, :companyname %\>

I suspect you mean

in\_place\_editor\_field ‘nocpage’, ‘companyname’

the first parameter should be the name of an instance variable, the  
second the name of a method on that object (the one that corresponds  
to the property to edit)

Fred

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 7, 2008, 7:35pm UTC](https://www.ruby-forum.com/t/in-place-edit-field-help/147959/3 "2008-09-07T19:35:59Z")

</div>

Thanks. The show page works but I am not getting an edit box to pop  
up. I see this with a view source:

**Companyname:**

att

On Sep 7, 12:23 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 7, 2008, 7:53pm UTC](https://www.ruby-forum.com/t/in-place-edit-field-help/147959/4 "2008-09-07T19:53:00Z")

</div>

DOH. Never mind. Forgot the javsacript include tag. I started this  
last night on a different computer.
