Skip to content
This repository has been archived by the owner on Nov 3, 2018. It is now read-only.

Commit

Permalink
[#17] Move markup for friend into partial
Browse files Browse the repository at this point in the history
  • Loading branch information
harlow committed Sep 5, 2012
1 parent dad72b5 commit 285c93c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
16 changes: 16 additions & 0 deletions app/views/friends/_friend.html.erb
@@ -0,0 +1,16 @@
<div class="friend" id="<%= friend.id %>">
<div class="front">
<%= link_to friend, class: 'pic-link' do %>
<%= image_tag friend.avatar.url(:square) %>
<% end %>
</div>

<div class="back">
<span class="friend-name"><%= friend.name %></span>
<div class="actions">
<%= link_to 'Show', friend %>
<%= link_to 'Edit', edit_friend_path(friend) %>
<%= link_to 'Delete', friend, confirm: 'Are you sure you want to lose a friend?', method: :delete, class: 'destroy' %>
</div>
</div>
</div>
18 changes: 1 addition & 17 deletions app/views/friends/index.html.erb
@@ -1,21 +1,5 @@
<h2>Make a new friend <%= link_to 'New Friend', new_friend_path, class: 'new-friend' %></h2>

<section id="friends">
<% @friends.each do |friend| %>
<div class="friend" id="<%= friend.id %>">
<div class="front">
<%= link_to friend, class: 'pic-link' do %>
<%= image_tag friend.avatar.url(:square) %>
<% end %>
</div>
<div class="back">
<span class="friend-name"><%= friend.name %></span>
<div class="actions">
<%= link_to 'Show', friend %>
<%= link_to 'Edit', edit_friend_path(friend) %>
<%= link_to 'Delete', friend, confirm: 'Are you sure you want to lose a friend?', method: :delete, class: 'destroy' %>
</div>
</div>
</div>
<% end %>
<%= render @friends %>
</section>

0 comments on commit 285c93c

Please sign in to comment.