Add GamePlatform to Game pages
authorIra W. Snyder <devel@irasnyder.com>
Mon, 26 Nov 2007 22:52:59 +0000 (14:52 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Mon, 26 Nov 2007 22:52:59 +0000 (14:52 -0800)
Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
app/controllers/game_platform_controller.rb
app/views/game/index.rhtml
app/views/game_platform/edit.rhtml
app/views/game_platform/list.rhtml
app/views/game_platform/new.rhtml
db/development.sqlite3

index 155bf97..49bf616 100644 (file)
@@ -1,4 +1,6 @@
 class GamePlatformController < ApplicationController
+  layout "admin"
+
   def index
     list
     render :action => 'list'
index c7c03d6..e6a4cf8 100644 (file)
@@ -8,4 +8,7 @@
   <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>
+  <br/>
+  <li><%= link_to 'List All Game Platforms', :controller => 'game_platform', :action => 'list' %></li>
+  <li><%= link_to 'Add a New Game Platform', :controller => 'game_platform', :action => 'new' %></li>
 </ul>
index 237e1d5..bbd88cc 100644 (file)
@@ -1,4 +1,4 @@
-<h1>Editing game_platform</h1>
+<h1>Editing Game Platform</h1>
 
 <% form_tag :action => 'update', :id => @game_platform do %>
   <%= render :partial => 'form' %>
index 3206a36..9323f6f 100644 (file)
@@ -1,20 +1,14 @@
-<h1>Listing game_platforms</h1>
+<h1>Listing Game Platforms</h1>
 
-<table>
+<table border="1">
   <tr>
-  <% for column in GamePlatform.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
+    <th>Name</th>
   </tr>
   
 <% for game_platform in @game_platforms %>
   <tr>
-  <% for column in GamePlatform.content_columns %>
-    <td><%=h game_platform.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'Show', :action => 'show', :id => game_platform %></td>
+    <td><%= link_to game_platform.name.to_s, :action => 'show', :id => game_platform %></td>
     <td><%= link_to 'Edit', :action => 'edit', :id => game_platform %></td>
-    <td><%= link_to 'Destroy', { :action => 'destroy', :id => game_platform }, :confirm => 'Are you sure?', :method => :post %></td>
   </tr>
 <% end %>
 </table>
@@ -24,4 +18,4 @@
 
 <br />
 
-<%= link_to 'New game_platform', :action => 'new' %>
+<%= link_to 'New Game Platform', :action => 'new' %>
index fdc286d..03f24b9 100644 (file)
@@ -1,4 +1,4 @@
-<h1>New game_platform</h1>
+<h1>New Game Platform</h1>
 
 <% form_tag :action => 'create' do %>
   <%= render :partial => 'form' %>
index 3ec86a6..237d41e 100644 (file)
Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ