Skip to content

Commit

Permalink
added html interface for votes
Browse files Browse the repository at this point in the history
  • Loading branch information
johndbritton committed Aug 15, 2010
1 parent 46c6162 commit 1e3f664
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/views/votes/_form.html.erb
Expand Up @@ -10,6 +10,14 @@
</div>
<% end %>

<div class="field">
<%= f.label :pitch_id %><br />
<%= f.text_field :pitch_id %>
</div>
<div class="field">
<%= f.label :user_id %><br />
<%= f.text_field :user_id %>
</div>
<div class="actions">
<%= f.submit %>
</div>
Expand Down
4 changes: 4 additions & 0 deletions app/views/votes/index.html.erb
Expand Up @@ -2,13 +2,17 @@

<table>
<tr>
<th>Pitch Id</th>
<th>User Id</th>
<th></th>
<th></th>
<th></th>
</tr>

<% @votes.each do |vote| %>
<tr>
<td><%= vote.pitch.id %></td>
<td><%= vote.user.id %></td>
<td><%= link_to 'Show', vote %></td>
<td><%= link_to 'Edit', edit_vote_path(vote) %></td>
<td><%= link_to 'Destroy', vote, :confirm => 'Are you sure?', :method => :delete %></td>
Expand Down
9 changes: 9 additions & 0 deletions app/views/votes/show.html.erb
@@ -1,5 +1,14 @@
<p class="notice"><%= notice %></p>

<p>
<b>Pitch Id:</b>
<%= @vote.pitch.id %>
</p>

<p>
<b>User Id:</b>
<%= @vote.user.id %>
</p>

<%= link_to 'Edit', edit_vote_path(@vote) %> |
<%= link_to 'Back', votes_path %>

0 comments on commit 1e3f664

Please sign in to comment.