I have a model Category in my Rails application that has an attribute Name. When adding an item of another model, I want the user to have the option of selecting category names from a dropdown list based on the class variable @categories.
To do this, I need to generate a string array of names from an array of type Category, but I am not quite sure how to do this without putting a string representation of the entire Category object in each dropdown item.
Does anyone know how to do this--get an array of class attributes from an array of class objects?