Write this method in user model
#copy the below code in /app/models/user.rb file` def wishes_count counter = 0 self.lists.each do |list| # this is similar to @user.lists counter += list.wishes.count #this is similar to @list.wishes end return counter end Howdy {Username}, you have made <%=h @user.list.count %> lists, and <%=h @user.wishes_count %> wishes
you can't use @user.wishes.count since user is not directly related to wishes, hope this solution works for you. If any questions please drop a comment.