# In\_place\_editor and lists

**URL:** <https://www.ruby-forum.com/t/in-place-editor-and-lists/69137>\
**Category:** Rails\
**Created:** [September 18, 2006, 10:53pm UTC](https://www.ruby-forum.com/t/in-place-editor-and-lists/69137 "2006-09-18T22:53:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdullah\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@Abdullah\_J](https://www.ruby-forum.com/u/Abdullah_J)\
**Post date:** [September 18, 2006, 10:53pm UTC](https://www.ruby-forum.com/t/in-place-editor-and-lists/69137/1 "2006-09-18T22:53:09Z")

</div>

Hi All,

I’m trying to use the in\_place\_editor with a list and ended up having to  
do  
this:

\<% for task in @tasks %\>

- Is there a way not to have to assign an instance variable for each task  
in  
@tasks just to use it with the in\_place\_editor\_field?

---

<div class="post-metadata">

**Author:** ![Abdullah\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@Abdullah\_J](https://www.ruby-forum.com/u/Abdullah_J)\
**Post date:** [September 19, 2006, 1:04pm UTC](https://www.ruby-forum.com/t/in-place-editor-and-lists/69137/2 "2006-09-19T13:04:37Z")

</div>

Abdullah J. wrote:

> in @tasks just to use it with the in\_place\_editor\_field?  
> for @task in @tasks

–  
We develop, watch us RoR, in numbers too big to ignore.

---

<div class="post-metadata">

**Author:** ![Abdullah\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@Abdullah\_J](https://www.ruby-forum.com/u/Abdullah_J)\
**Post date:** [September 19, 2006, 5:56pm UTC](https://www.ruby-forum.com/t/in-place-editor-and-lists/69137/3 "2006-09-19T17:56:24Z")

</div>

Hi Mark,  
That gives me this error:  
NameError in Tasks#index

Showing _app/views/tasks/list.rhtml_ where line _#9_ raised:

undefined local variable or method `task’ for  
#\<#Class:0xb7844628:0xb7844600\>

Thanks,  
Abdullah

---

<div class="post-metadata">

**Author:** ![Abdullah\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@Abdullah\_J](https://www.ruby-forum.com/u/Abdullah_J)\
**Post date:** [September 20, 2006, 4:03am UTC](https://www.ruby-forum.com/t/in-place-editor-and-lists/69137/4 "2006-09-20T04:03:39Z")

</div>

Abdullah J. wrote:

> That gives me this error:
> 
> NameError in Tasks#index
> 
> Showing /app/views/tasks/list.rhtml/ where line _#9_ raised:
> 
> |undefined local variable or method `task’ for #\<#Class:0xb7844628:0xb7844600\>|

Abdullah, did you delete the \<% @task = task %\> line, and just have:

\<% for @task in @tasks %\>

- ?

---

<div class="post-metadata">

**Author:** ![Abdullah\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@Abdullah\_J](https://www.ruby-forum.com/u/Abdullah_J)\
**Post date:** [September 24, 2006, 4:55pm UTC](https://www.ruby-forum.com/t/in-place-editor-and-lists/69137/5 "2006-09-24T16:55:55Z")

</div>

Yeah, I did… I wonder why you can’t assign instance variables like  
that it  
the for loop.

---

<div class="post-metadata">

**Author:** ![Abdullah\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@Abdullah\_J](https://www.ruby-forum.com/u/Abdullah_J)\
**Post date:** [August 17, 2007, 12:38pm UTC](https://www.ruby-forum.com/t/in-place-editor-and-lists/69137/6 "2007-08-17T12:38:04Z")

</div>

Abdullah J. wrote:

> Yeah, I did… I wonder why you can’t assign instance variables like  
> that it  
> the for loop.

This should work:

\<% for @task in @tasks %\>

- \<%= in\_place\_editor\_field "task", "name" %\> \<% end %\>
