Skip to content

Instantly share code, notes, and snippets.

@leemcalilly
Created July 30, 2013 01:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leemcalilly/a8c4c808e5e8a802933b to your computer and use it in GitHub Desktop.
Save leemcalilly/a8c4c808e5e8a802933b to your computer and use it in GitHub Desktop.
<% provide(:title, 'Photos') %>
<section class="upload-photo">
<div class="row">
<div class="span12">
<% if can? :create, @photo %>
<%= render 'form' %>
<% end %>
</div>
</div>
</section>
<section class="browse-photos">
<div class="row">
<div class="span12">
<div class="row">
<% if @photos.present? %>
<% @photos.each do |photo| %>
<div class="image-preview span4">
<%= link_to image_tag(photo.image_url(:small).to_s), photo %>
<p>
URL:
<input value="<%= photo.image_url(:large) %>" class="select-all-on-click">
</p>
<p><%= photo.image_identifier %></p>
<% if can? :destroy, @photo %>
<p>
<%= link_to 'View', photo_path(photo) %> |
<%= link_to 'Delete', photo, method: :delete, data: { confirm: 'Are you sure?' } %>
</p>
<% end %>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment