Add GameGenres to the Games page
authorIra W. Snyder <devel@irasnyder.com>
Mon, 26 Nov 2007 22:48:18 +0000 (14:48 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Mon, 26 Nov 2007 22:48:18 +0000 (14:48 -0800)
Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
app/controllers/game_genre_controller.rb
app/views/game/index.rhtml
app/views/game_genre/list.rhtml
db/development.sqlite3

index ef2b4e1..50f27c2 100644 (file)
@@ -1,4 +1,6 @@
 class GameGenreController < ApplicationController
+  layout "admin"
+
   def index
     list
     render :action => 'list'
index 280522d..c7c03d6 100644 (file)
@@ -5,4 +5,7 @@
   <li><%= link_to 'List All Games', :action => 'list' %></li>
   <li><%= link_to 'Search for a Game', :action => 'search' %></li>
   <li><%= link_to 'Add a New Game', :action => 'new' %></li>
+  <br/>
+  <li><%= link_to 'List All Game Genres', :controller => 'game_genre', :action => 'list' %></li>
+  <li><%= link_to 'Add a New Game Genre', :controller => 'game_genre', :action => 'new' %></li>
 </ul>
index 83c005c..63f595e 100644 (file)
@@ -1,20 +1,14 @@
-<h1>Listing game_genres</h1>
+<h1>Listing Game Genres</h1>
 
 <table>
   <tr>
-  <% for column in GameGenre.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
+    <th>Name</th>
   </tr>
   
 <% for game_genre in @game_genres %>
   <tr>
-  <% for column in GameGenre.content_columns %>
-    <td><%=h game_genre.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'Show', :action => 'show', :id => game_genre %></td>
+    <td><%= link_to game_genre.name.to_s, :action => 'show', :id => game_genre %></td>
     <td><%= link_to 'Edit', :action => 'edit', :id => game_genre %></td>
-    <td><%= link_to 'Destroy', { :action => 'destroy', :id => game_genre }, :confirm => 'Are you sure?', :method => :post %></td>
   </tr>
 <% end %>
 </table>
@@ -24,4 +18,4 @@
 
 <br />
 
-<%= link_to 'New game_genre', :action => 'new' %>
+<%= link_to 'Add a New Game Genre', :action => 'new' %>
index ce9e0e6..3ec86a6 100644 (file)
Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ