Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
where the partial is called:
<ul class="user_avatars">
<%= render :partial => 'users/user_avatar', collection: @users %>
<%= render @users %>
</ul>
_user_avatar.html.erb:
<li>
<%= image_tag @users.avatar.url(:thumb) %>
</li>
_user.html.erb:
<li>
<%= image_tag user.avatar.url(:thumb) %>
<%= link_to user.nice_name, user %>
<li>
Also, I have this in the pages controller, which controls the home page, where these are called:
def home
@title = "Home"
@users = User.order('created_at DESC').limit(9)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment