Created
January 29, 2014 17:57
-
-
Save borisd/8693327 to your computer and use it in GitHub Desktop.
Cats table.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="media-grid"> | |
<% @cats.each do |cat| %> | |
<li class='thumbnail'> | |
<%= link_to cat_path(cat) do %> | |
<%= image_tag cat.image.url, alt: cat.name %> | |
<% end %> | |
<ul class="controls"> | |
<% if can_like?(cat) %><li><%= link_to 'Like', like_cat_path(cat), method: :post, :class => 'btn btn-mini' %></li><% end %> | |
<% if can_unlike?(cat) %><li><%= link_to 'UnLike', unlike_cat_path(cat), method: :post, :class => 'btn btn-mini' %></li><% end %> | |
<% if can_edit?(cat) %><li><%= link_to 'Edit', edit_cat_path(cat), :class => 'btn btn-mini' %></li><% end %> | |
<% if can_edit?(cat) %><li><%= link_to 'Destroy', cat_path(cat), :method => :delete, :data => { :confirm => 'Are you sure?' }, :class => 'btn btn-mini btn-danger' %></li><% end %> | |
</ul> | |
</li> | |
<% end %> | |
</ul> | |
<div style='clear:both'></div> | |
<%= link_to 'New', new_cat_path, :class => 'btn btn-primary' %> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment