REXML usage - accessing one item
I'm reading the following XML file using REXML in rails.
<xml>
<event id='2288'>
<venue_id>1</venue_id>
</event>
<venue id='1'>
<name>hello</name>
</venue>
</xml>
The code I use my controller is this:
@events = droot.elements.to_a("//event")
@venues = droot.elements.to_a("//venue")
This works and my data is loaded into each array.
But the problem I'm having is accessing a specific venue from that array.
I've tried stuff like this, but no luck:
<%= @venues[@id=1].elements['name'] %>
Can anybody help me access one particular element in the array? In my view I end up looping through each event and just need to access the associated venue. (This is from the zvents API) Thanks for any help!