Help from rubyonrails 2.1

hi every one !
receintly i am working on rails 2.1,i have start it from scaffold
,besides from the pages which is created by scaffold automatically ,i
have created the page "ingrendient.html.erb" and i have added the method
def ingredient

but i have faced the error massage when i tried to open the page
error massage is
"Couldn't find Drug with ID=ingredient"
can anyone help me .please

The scaffold in Rails 2.1 uses what is called Resources ( In your config/routes.rb, you should see a line like:

map.resources :recipes

To add a custom method outside the standard 7 (index, show, new, create, edit, update, destroy), you need to tell resources about it. There are 2 different types of methods on a resource: collection and member. If the action acts on multiple models, it’s a collection, if it acts on a single model (requires params[:id]), then it is a member.

map.resources :recipes, :collection => {:ingredients => :get}

Hope that helps,

thanks Brandon it helped me out!