That probably means that params[:id] is nil for some reason. First
check in development.log where it will show you the parameters passed
in when you open the url. Then you will know whether the id is not
being passed in or whether you are loosing it somewhere along the way.
Next have a look at the Rails Guide on debugging to see techniques
that you can use to debug the code.
I think you want "member" instead of "collection" in your route file.
Collection is used when you don't have an id; member when you do. In
your controller you are using the id, so I'm assuming that this is the
URL you want: http://localhost:3000/customers/1/friend
I think you want "member" instead of "collection" in your route file.
Collection is used when you don't have an id; member when you do. In
your controller you are using the id, so I'm assuming that this is the
URL you want: http://localhost:3000/customers/1/friend
Yeah thank to both of you, member was best and works now