Quantcast
Viewing all articles
Browse latest Browse all 12

"Developing a social networking site part 2 - rating stars" by s01ipsist

Great work! If the object hasn't been rated it can't have an average rating. Changing` o.rating_average` to 0 in the below code saves me a sql call (I'm using the stats table) r= "Not yet Rated" r += `star_rating(o.rating_average, o_type, o.id, can_rate)`

Viewing all articles
Browse latest Browse all 12

Trending Articles