undefined method `find_all'

i have modified my code as follows:

<%= collection_select(:category, :id, @categories, :id, :category_type, options ={:prompt => "-Select a Category"}, :class =>"category") %>

i Hav also modified the definition in my controllers as follows:

@categories = category.find(:all)

You have a nil object when you didn't expect it!

You might have expected an instance of Array. The error occurred while evaluating nil.map

seems there something i dont get

Classes should have a capital:

Category.find(:all)

and you could even bring this down to:

Category.all

Best regards

Peter De Berdt

i have modified my code as follows:

<%= collection_select(:category, :id, @categories, :id, :category_type, options ={:prompt => "-Select a Category"}, :class =>"category") %>

i Hav also modified the definition in my controllers as follows:

@categories = category.find(:all)

That should be Category.find(:all)

You have a nil object when you didn't expect it!

You might have expected an instance of Array. The error occurred while evaluating nil.map

seems there something i dont get

You have not said where that error occurs, but wherever it is something is nil. Have a look at the Rails Guide on Debugging, that will show you how to use ruby-debug to break into code, inspect data and follow the flow. Then when you get this sort of error you can put in breakpoints and check each of the variables to find which one is nil.

Colin