As a beginner in Ruby and JavaScript, I am unsure of my actions. I have a dropdown box that I want to display by unique name.
- Using JavaScript (CoffeeScript), I retrieve results with JSON.
- I have implemented a method to display by unique name, which is functioning correctly.
My issue is how do I obtain both IDs? When selecting an object, the ID becomes the value, and the text method represents the name. For instance, if I have 3 objects with the same name, I need to retrieve three IDs. Currently, I am only able to get one.
Is there an alternative approach to address this? Thank you!
TABLE OBJECTS
ID
NAME (with duplicates)
MODEL
UNIQUE INDEX (NAME, MODEL)