diff --git a/app/helpers/pools_helper.rb b/app/helpers/pools_helper.rb index 2c2e59083..8f7dd1d71 100644 --- a/app/helpers/pools_helper.rb +++ b/app/helpers/pools_helper.rb @@ -1,6 +1,10 @@ module PoolsHelper - def recent_updated_pools(&block) + def recent_updated_pools pool_ids = session[:recent_pool_ids].to_s.scan(/\d+/) - Pool.where(["id IN (?)", pool_ids]).each(&block) if pool_ids.any? + if pool_ids.any? + Pool.where(["id IN (?)", pool_ids]) + else + [] + end end end diff --git a/app/views/comment_votes/create.js.erb b/app/views/comment_votes/create.js.erb index 20f465b7e..f7d5baf61 100644 --- a/app/views/comment_votes/create.js.erb +++ b/app/views/comment_votes/create.js.erb @@ -1,3 +1,5 @@ <% if @error %> - alert(<%= escape_javascript(@error.to_s) %>); + alert("<%= escape_javascript(@error.to_s) %>"); +<% else %> + $("#score-for-comment-<%= @comment.id %>").html("<%= pluralize @comment.score, 'point' %>"); <% end %> diff --git a/app/views/comments/index_by_post.html.erb b/app/views/comments/index_by_post.html.erb index d2fb5dbf9..2f99634fc 100644 --- a/app/views/comments/index_by_post.html.erb +++ b/app/views/comments/index_by_post.html.erb @@ -1,5 +1,5 @@ -
<%= link_to comment.creator_name, user_path(comment.creator_id) %>
- ++ +
+<%= pluralize comment.score, "point" %>