Specifically, on an index page, you might have
@users.each do |user|
render 'layouts/shortprofile'
end
where short profile contains data from the user and other related models.
The partial is trying to read from the index method in the user model, but there is no variable defined in that method for an individual user. It feels like the |user| block var should read into the partial, but it doesn't seem to.
For example, in the partial I might want to have something like -
user.blogs[1..3].each do |blog|
blog.title
blog.created_at
.....
... but I don't know how to get the user value into the partial.
I want to keep it as a partial cos it's displayed in several contexts and I want to be DRY.