> > <%div_for(comment) do %>
> >         <div id="comment_user"><%= user_for(comment.user_id)%><div
>
> I don't know that user_for does, but that obviously won't use the
> comment.user object that has already been loaded.

well, the User object has many comments, the comments belong to user.
As far as I can tell, calling comment.user will return nothing because
there is only a user_id field.
perhaps I could set up a Comment has_one :user relationship?

anyway the user_for method just returns the user name that belongs to
that particular user_id.

         <div id="vote_score_<%=comment.id%>" class="cvote_score">
> >                         <%= comment.reload.total_votes %>
>
> Well this is why you get lots of queries loading the comment

Thanks, I can't remember why that reload was ever put in there, but it
certainly removed all the database calls when I got rid of it.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to