# Scaffold return to index page

**URL:** <https://www.ruby-forum.com/t/scaffold-return-to-index-page/146890>\
**Category:** Rails\
**Created:** [August 26, 2008, 3:39pm UTC](https://www.ruby-forum.com/t/scaffold-return-to-index-page/146890 "2008-08-26T15:39:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rustam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/2bfe46/32.png) [@rustam](https://www.ruby-forum.com/u/rustam)\
**Post date:** [August 26, 2008, 3:39pm UTC](https://www.ruby-forum.com/t/scaffold-return-to-index-page/146890/1 "2008-08-26T15:39:03Z")

</div>

i am using rubyonrails 2.1 and i have used scaffold .on controller i  
added new method and html.erb now what i want is to back to the  
index.html.erb page of the scaffold ,i have tried to use render but on  
the original scaffold i have met the problem on the below  
“You have a nil object when you didn’t expect it!  
You might have expected an instance of Array.  
The error occurred while evaluating nil.each”  
can any one tell me what should i do thanks.

---

<div class="post-metadata">

**Author:** ![rustam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/2bfe46/32.png) [@rustam](https://www.ruby-forum.com/u/rustam)\
**Post date:** [August 26, 2008, 4:50pm UTC](https://www.ruby-forum.com/t/scaffold-return-to-index-page/146890/2 "2008-08-26T16:50:44Z")

</div>

On Tue, Aug 26, 2008 at 3:39 PM, Rustam M.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> i am using rubyonrails 2.1 and i have used scaffold .on controller i  
> added new method and html.erb now what i want is to back to the  
> index.html.erb page of the scaffold ,i have tried to use render but on  
> the original scaffold i have met the problem on the below  
> “You have a nil object when you didn’t expect it!  
> You might have expected an instance of Array.  
> The error occurred while evaluating nil.each”  
> can any one tell me what should i do thanks.

you must use redirect\_to, render :action only display the action it  
does not execute the method

–  
Gabriel L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
