Update psot vote status in js

This commit is contained in:
Rei
2014-01-16 14:51:11 +08:00
parent 3d1251398f
commit 8eacef1d6e
8 changed files with 46 additions and 29 deletions

View File

@@ -1,2 +1,7 @@
module PostsHelper
def post_votes(posts, user)
user.post_votes.where(post_id: posts.pluck(:id)).map { |post_vote|
{ post_id: post_vote.post_id, value: post_vote.value }
}
end
end