That doesn't quite work. When I use <%= @review.votes_count %> in the
create.js.erb file it updates the counter on the first review,
regardless of whether the vote was placed on the first review or not.

I thought maybe if I loop through the reviews again the create.js.erb
file it might work.

<% @house.reviews.each do |review| %>
$("#votes").html("<%= review.votes_count %>")
<% end %>

This did not work either.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 6 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 14, '11 at 12:31a
activeOct 16, '11 at 2:27a
posts6
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Sean Six: 4 posts Tim Shaffer: 2 posts

People

Translate

site design / logo © 2022 Grokbase