Initital scaffolding of the website plus initial work on the adding and
[selectricity] / app / views / elections / list.rhtml
diff --git a/app/views/elections/list.rhtml b/app/views/elections/list.rhtml
new file mode 100644 (file)
index 0000000..40e24b5
--- /dev/null
@@ -0,0 +1,27 @@
+<h1>Listing elections</h1>
+
+<table>
+  <tr>
+  <% for column in Election.content_columns %>
+    <th><%= column.human_name %></th>
+  <% end %>
+  </tr>
+  
+<% for election in @elections %>
+  <tr>
+  <% for column in Election.content_columns %>
+    <td><%=h election.send(column.name) %></td>
+  <% end %>
+    <td><%= link_to 'Show', :action => 'show', :id => election %></td>
+    <td><%= link_to 'Edit', :action => 'edit', :id => election %></td>
+    <td><%= link_to 'Destroy', { :action => 'destroy', :id => election }, :confirm => 'Are you sure?' %></td>
+  </tr>
+<% end %>
+</table>
+
+<%= link_to 'Previous page', { :page => @election_pages.current.previous } if @election_pages.current.previous %>
+<%= link_to 'Next page', { :page => @election_pages.current.next } if @election_pages.current.next %> 
+
+<br />
+
+<%= link_to 'New election', :action => 'new' %>

Benjamin Mako Hill || Want to submit a patch?