Displaying 2 results from an estimated 2 matches for "song_nam".
Did you mean:
song_name
2006 Jun 09
0
Calculations based on multiple tables
...find_all_by_contest_id(@contest.id)
@contest_entries.each do |contest_entry|
songs = ContestRating.find_all_by_contest_entry_id
(contest_entry.id.to_s)
total = 0
songs.each do |song|
total += song.score
end
average_score = total.to_f / songs.size.to_f
song_name = Song.find_by_id(contest_entry.song_id)
end
end
Thank you,
Dave Hoefler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060609/4bfdba9f/attachment.html
2006 Jul 08
9
How to handle dynamically columned tables in rails
...e to columns by type of
data on the fly.
So, select * from core_list_items where list_num=X and then join it with
columns in the Date_items table and the text_items table and then the
date_items table. I have to do multiple join statements, sometimes from
the same table.
ID TITLE DESCRIPTION SONG_NAME (from text table) PUB_DATE (from date
table) RECORD_LABEL (also from text table).
I have made this work in PHP, but is there a way to do this in rails? I
posted this under a different topic, and I''ve seen suggestions that
require migrations and other back-end work to make this happen...