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
ingredient
def ingredient
end
but i have faced the error massage when i tried to open the page
ingredient.html.erb
error massage is
“Couldn’t find Drug with ID=ingredient”
can anyone help me .please
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.