Ok so i am creating an hash and i need to add the id to the hash..here is my code
h = Hash.new {|h1, k1| h1[k1] = Hash.new{|h2, k2| h2[k2] = []}}
@result, today = [ h, h.dup], Date.today
Request.find_all_by_artist("Metallica", :select => "DISTINCT venue, showdate, LOWER(song) AS song, id").each do |req|
# need to insert the req.id in the hash somewhere
idx = req.showdate < today ? 0 : 1
@result[idx][req.venue][req.showdate] << req.song.titlecase
end
any suggestions on how to do this
here is my loop in the view
<% @result.each do |venue, date| %>
<li>
<a href="#"><%= venue %></a>
<% date.each do |key, song| %>
<%= key %>
<ul class="acitem">
<% puts key.inspect %>
<% puts song.inspect %>
<% songs.each do |each_song, count| %>
<li><%= each_song %> <%= each_song %></li>
<% end %><% end %>
</ul>
</li>
<% end %>
i need to have the id of every request as well....any ideas