"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!
I believe this is a problem with your view and the way you're using pluralize you're supposed to pass it the singular version of your noun, and optionally a plural version (in case it can't guess it correctly).
I believe this is a problem with your view and the way you're using pluralize--you're supposed to pass it the singular version of your noun, and optionally a plural version (in case it can't guess it correctly). Please see my change on GitHub. Here's a screenshot: Update After messing with your app, somehow it's possible to get video.
Vote_sum (the actual database value) to be different than video. Video_votes. Sum(:value); I'm not yet sure why.
However, you do have another issue with your codebase, demonstrated below: ruby-1.9.2-p136 :001 > v = Video. Find 2 => # ruby-1.9.2-p136 :002 > v. Video_votes.
Sum(:value) => 2 ruby-1.9.2-p136 :003 > v. Vote_sum => 2 # doesn't match vote_sum in the database! You have a method called vote_sum on your Video model.
This means when you access @video. Vote_sum, you are NOT accessing the vote_sum property from the model from the database, because you overwrite that functionality. This makes it pointless to update vote_sum in VideoVote's after_create because you can never access it (as demonstrated in my IRB session, above).
Thanks! You're good :) – Justin Meltzer Mar 20 at 1:45.
You should to reload the video: if @vote. Save @video. Reload respond_to do |format| format.
Html { redirect_to @video } There might be other way to reload vote_sum only without reloading @video but this should be quite enough for the start. Also please note you could have a better use of model :counter_cache when you would separate up and down votes to separate relation/models ... it's sad but sometimes to get full power of rails you need to make freaky things with your models.
– Justin Meltzer Mar 19 at 23:43 cause you loaded @video before updating it's vote_sum, when you want to get the current vote_sum you need to reload @video – mpapis Mar 19 at 23:49 This doesn't fix the issue :/ – Justin Meltzer Mar 20 at 0:07.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.