Skip to content

Commit

Permalink
hide button if prizes don't have any remaining to be won
Browse files Browse the repository at this point in the history
  • Loading branch information
jwang committed Jul 24, 2011
1 parent 9a11806 commit c9c04f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/views/home/index.html.erb
Expand Up @@ -10,7 +10,11 @@
<% if current_user && current_user.admin? %>
<%= form_for :winner, :url => entries_pick_path do |f| %>
<%= f.submit 'Pick a winner' %>
<% if Prize.remaining.size > 0 %>
<%= f.submit 'Pick a winner' %>
<% else %>
<p>Sorry, no more prizes to hand out.</p>
<% end %>
<% end %>
<% end %>
Expand Down

0 comments on commit c9c04f1

Please sign in to comment.