Skip to content
Browse files

fix index and show

  • Loading branch information...
1 parent 9840285 commit f97896c586466aa75d231765e1f92dabcced7558 @barthezslavik committed Dec 22, 2012
Showing with 11 additions and 3 deletions.
  1. +8 −2 app/views/samples/index.html.haml
  2. +3 −1 app/views/samples/show.html.haml
View
10 app/views/samples/index.html.haml
@@ -1,5 +1,11 @@
-- @samples.each do |sample|
- %p= link_to sample.name, sample, data:{ push: true }
+%table
+ - @samples.each do |sample|
+ %tr
+ %td
+ - screenshot = image_tag sample.screenshot.url(:medium) if sample.screenshot
+ - if sample.screenshot_file_name?
+ = screenshot
+ %td= link_to sample.name, sample, data:{ push: true }
/= link_to 'Edit', edit_sample_path(sample)
/= link_to 'Destroy', sample, :confirm => 'Are you sure?', :method => :delete
View
4 app/views/samples/show.html.haml
@@ -2,7 +2,9 @@
%h2= @sample.name
%pre= @sample.description
-=image_tag @sample.screenshot.url(:medium)
+- if @sample.screenshot_file_name?
+ =image_tag @sample.screenshot.url(:large)
+ =image_tag @sample.screenshot.url
/= link_to 'Edit', edit_sample_path(@sample)
/= link_to 'Back', samples_path

0 comments on commit f97896c

Please sign in to comment.
Something went wrong with that request. Please try again.