Closed megazear7 closed 10 years ago
Add this to the model / db:
armies has_many comments
games has_many comments, through: :armies
comments belong_to army # this will be who sent the army (comment.army.user is creator of comment)
comments belong_to user # this will be who the comment was sent to (only used if comment.comment_type is "whisper"
create_table comments do |t|
t.string :content
t.string :comment_type # expects: "public", "team", "whisper"
t.integer :user_id # this would be which user the comment was sent to
t.integer :army_id
Then on the show page make a list:
game.comments.each do |c|
if c.comment_type == "public" or c.comment_type == team and c.army.alliance == current_user.alliance or c.comment_type == "whisper" and c.user = current_user
%span.comment= c.army.user + " says: " + c.content
%br
end
Then add a new form to the game right below the listing of comments.
This should be added to the game show page.