I'm working on someone else's site, and am trying to reference a value's ID in my HAML file, but I've tried every iteration I can think of and can't figure out how to do this. I'm trying to get the ID of a want, which belongs to a project, which belongs to a user. Here's some code from the projects model:

This returns an array of wants, which it iterates through. I was initially confused because the wants seem to have ids in some of the views, but when I tried referencing project.want[0], for example, that worked perfectly. My question is - how do I pass user(id of blah).project(id of blah).want[place blah in array] ?

Sometimes it's not an error - when I try to link to project.wants("project_#{ project.id }_wants")), :user => project.user I get the bizarre URL localhost:3000/users/2/… It's like it's loading all the wants as one "unit" and assigning them numbers on the fly. Should I iterate through them?
–
USKDec 6 '13 at 21:26

The trouble is, I want to filter by the want ID, even if it's assigned on the fly
–
USKDec 6 '13 at 21:30

Further investigation reveals the wants are definitely an array.
–
USKDec 6 '13 at 21:33