Issue
I have tables of venues, reviews and comments where a venue can have many reviews and a review can have many comments.
The reviews themselves are shown as partials on the venues show page using:
<%= render :partial => 'reviews/review', :collection => @venue.reviews %>
I thought using this:
<%= render :partial => 'comments/comment', :collection => @review.comments %>
inside the review partial would succesfully show the comments for that particular review but its just not displaying anything and giving no errors.
using <%= review.comments.count %>
in the review partial does correctly show the number of comments added and checking the comments records in the console shows they have the correct foreign keys.
Any help is much appreciated!
Solution
"did you tried changing @review to review in second one? – rubish Jul 25 at 22:48"
Answered By - Dave Answer Checked By - Clifford M. (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.