Cookbook2

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. 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

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” [email protected]
To: [email protected]
Sent: 2006-04-11 1:12 PM
Subject: [Rails] cookbook2

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 ,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…

Hi Adnan,

My email should appear under the ------ Original Message ---------
line
when you reply. Just in case, I’m at [email protected].

Let’s take this off list.

Bill
----- Original Message -----
From: “Adnan Sikander” [email protected]
To: [email protected]
Sent: 2006-04-11 1:52 PM
Subject: [Rails] Re: cookbook2

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

Thanks

Adnan