# Cookbook2

**URL:** <https://www.ruby-forum.com/t/cookbook2/93838>\
**Category:** Rails\
**Created:** [April 11, 2006, 8:12pm UTC](https://www.ruby-forum.com/t/cookbook2/93838 "2006-04-11T20:12:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adnan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@adnan](https://www.ruby-forum.com/u/adnan)\
**Post date:** [April 11, 2006, 8:12pm UTC](https://www.ruby-forum.com/t/cookbook2/93838/1 "2006-04-11T20:12:46Z")

</div>

I am a new user to RoR/ I have been working on RoR cookbook2 tutorial  
which could be found at  
[http://instantrails.rubyforge.org/tutorial/index.html](http://instantrails.rubyforge.org/tutorial/index.html). As I have been  
going through different stages through trial and error, but now a stage  
has come that i m stuck and not able to proceed any further. when it  
comes to create a list.rhtml in recipe folder under views, and editing  
the code which is given in tutorial. Unfortunatley I am not able to make  
it work as I am getting the same error which is  
Missing template.script/…/config/…/app/views/recipe/list.rhtml  
I am not able to proceed an seeking for advice.

Thanks

Adnan

---

<div class="post-metadata">

**Author:** ![adnan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@adnan](https://www.ruby-forum.com/u/adnan)\
**Post date:** [April 11, 2006, 8:27pm UTC](https://www.ruby-forum.com/t/cookbook2/93838/2 "2006-04-11T20:27:30Z")

</div>

Hi Adnan,

I can’t tell from your post exactly what difficulty you’re having. The  
error message below says you don’t have a list.rhtml file. Need more  
info  
to provide assistance. You can contact off-list if you prefer.

Best regards,  
Bill

----- Original Message -----  
From: “Adnan Sikander” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: 2006-04-11 1:12 PM  
Subject: [Rails] cookbook2

---

<div class="post-metadata">

**Author:** ![adnan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@adnan](https://www.ruby-forum.com/u/adnan)\
**Post date:** [April 11, 2006, 8:52pm UTC](https://www.ruby-forum.com/t/cookbook2/93838/3 "2006-04-11T20:52:42Z")

</div>

Hi Bill,

I am not able to get your email address other wise would have meial u  
straight away. But anyway thanks for getting back to me.

I am practicing the RoR tutorial cookbook2  
[http://instantrails.rubyforge.org/tutorial/index.html](http://instantrails.rubyforge.org/tutorial/index.html) ,i have created  
the database cookbook2,created recipes,entered info in it and got to  
listing recipe,then i followed these instruction from the tutorial  
,these are the notes from the stage where i get stuck,

What Just Happened?  
A single line of code, scaffold :recipe, brought everything to life. It  
let us begin working with our data model. With virtually no work on our  
part, it created the actions list, show, edit, and delete. It also  
created default view templates for each of these actions.

Of course, these actions and views are very plain–not the sort of thing  
you’d want users to see (unless they are total geeks). The good news is  
that we can leave the scaffolding in place and slowly, one at a time,  
provide our own versions of the actions and views. Each time you create  
one of the actions or views it will override the scaffold’s version.  
When you’re done, simply remove the scaffold statement from the  
controller.

Before we do that, did you notice the URLs as you were playing around  
with your new cookbook? Rails tries very hard to present the user with  
pretty URLs. Rails URLs are simple and straightforward, not long and  
cryptic.

Creating Actions and Views  
The page that shows the list of all recipes (Figure 39 above)  
desperately needs improvement. The way to do that is to take over the  
handling of the list action from the scaffolding.

Edit recipe\_controller.rb and add a list method similar to Figure 40.  
Because we just created our own definition for the list action, Rails no  
longer uses the scaffold version. Rails called our list method and then  
tried to find a view template to render. Because we did not create one,  
we received this “template missing” error. Let’s create our own view  
template for the list action that only shows each recipe’s title and  
date.

When we created our recipe controller, the generate controller script  
also created a view directory where we can place the HTML templates that  
the recipe controller can display. We need to create a template file  
named list.rhtml. If you have worked with JSP or ASP pages, this will  
look familiar. It is simply an html file with Ruby code embedded within  
\<% %\> and \<%= %\> tags.,and i have entered all the code given there on  
the web,getting the error…Missing  
template.script/…/config/…/app/views/recipe/list.rhtml…

---

<div class="post-metadata">

**Author:** ![adnan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@adnan](https://www.ruby-forum.com/u/adnan)\
**Post date:** [April 11, 2006, 9:08pm UTC](https://www.ruby-forum.com/t/cookbook2/93838/4 "2006-04-11T21:08:29Z")

</div>

Hi Adnan,

My email should appear under the ------ Original Message ---------  
line  
when you reply. Just in case, I’m at removed\_email\_address@domain.invalid.

Let’s take this off list.

Bill  
----- Original Message -----  
From: “Adnan Sikander” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: 2006-04-11 1:52 PM  
Subject: [Rails] Re: cookbook2

---

<div class="post-metadata">

**Author:** ![adnan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@adnan](https://www.ruby-forum.com/u/adnan)\
**Post date:** [April 11, 2006, 9:35pm UTC](https://www.ruby-forum.com/t/cookbook2/93838/5 "2006-04-11T21:35:14Z")

</div>

Hi Bill,i have email you few screen shots hopefully wil make some  
sense.

Thanks

Adnan
