Permalink
Browse files

Only display other picture links when there is more than one.

  • Loading branch information...
1 parent d46bc49 commit b26be5e635d48401ead003c6e6146edc838d115c @quattro004 committed May 28, 2011
Showing with 8 additions and 6 deletions.
  1. +8 −6 app/views/recipes/show.html.erb
@@ -14,12 +14,14 @@
<% unless @recipe.picture.empty? %>
<div class="floatRight">
<img src="<%= url_for(:action => 'show', :id => @recipe.picture[0].id, :controller => 'pictures') %>" class="floatRight"/>
- <br/>
- <center>
- <% @recipe.picture.each_with_index do |picture, index| %>
- <%= link_to index + 1, picture_path(picture) %>
- <% end %>
- </center>
+ <% if @recipe.picture.size > 1 %>
+ <br/>
+ <center>
+ <% @recipe.picture.each_with_index do |picture, index| %>
+ <%= link_to index + 1, picture_path(picture) %>
+ <% end %>
+ </center>
+ <% end %>
</div>
<% end %>

0 comments on commit b26be5e

Please sign in to comment.