Displaying 2 results from an estimated 2 matches for "contestentry".
2006 Jun 01
0
Possible RJS Implementation?
...lt;% end %>
</div>
The two actions in the methods that handle the corresponding actions look
like this:
def contest_enter
#enter2: finish submission of song to contest
@contest = Contest.find(params[:id])
@song = Song.find(params[:song_id])
@member = session[:member_id]
ContestEntry.find_or_create_by_song_id_and_contest_id(@song.id,@
contest.id)
@elgibile_songs = ContestEntry.elgibile_songs(@member.id, @contest.id)
end
def contest_unsubmit
#unsubmit: remove a contest entry
@contest = Contest.find(params[:id])
@song = Song.find(params[:song_id])
c = ContestEnt...
2006 Jun 09
0
Calculations based on multiple tables
...est.
I made an ERD of my table structure which can be found at:
http://antrover.com/erd/contest_question.jpg
Here''s my model structure:
------------------------
class Contest < ActiveRecord::Base
has_many :contest_entries
has_many :songs, :through => :contest_entries
end
class ContestEntry < ActiveRecord::Base
belongs_to :song
belongs_to :contest
has_many :contest_ratings
end
class ContestRating < ActiveRecord::Base
belongs_to :contest_entry
end
class Song < ActiveRecord::Base
belongs_to :member
has_many :contest_entries, :dependent => true
end
class Member...