From 49780de1e4382884d99126b3d48f5ad232deb91e Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Mon, 26 Nov 2007 14:48:18 -0800 Subject: [PATCH] Add GameGenres to the Games page Signed-off-by: Ira W. Snyder --- app/controllers/game_genre_controller.rb | 2 ++ app/views/game/index.rhtml | 3 +++ app/views/game_genre/list.rhtml | 14 ++++---------- db/development.sqlite3 | Bin 30720 -> 30720 bytes 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/controllers/game_genre_controller.rb b/app/controllers/game_genre_controller.rb index ef2b4e1..50f27c2 100644 --- a/app/controllers/game_genre_controller.rb +++ b/app/controllers/game_genre_controller.rb @@ -1,4 +1,6 @@ class GameGenreController < ApplicationController + layout "admin" + def index list render :action => 'list' diff --git a/app/views/game/index.rhtml b/app/views/game/index.rhtml index 280522d..c7c03d6 100644 --- a/app/views/game/index.rhtml +++ b/app/views/game/index.rhtml @@ -5,4 +5,7 @@
  • <%= link_to 'List All Games', :action => 'list' %>
  • <%= link_to 'Search for a Game', :action => 'search' %>
  • <%= link_to 'Add a New Game', :action => 'new' %>
  • +
    +
  • <%= link_to 'List All Game Genres', :controller => 'game_genre', :action => 'list' %>
  • +
  • <%= link_to 'Add a New Game Genre', :controller => 'game_genre', :action => 'new' %>
  • diff --git a/app/views/game_genre/list.rhtml b/app/views/game_genre/list.rhtml index 83c005c..63f595e 100644 --- a/app/views/game_genre/list.rhtml +++ b/app/views/game_genre/list.rhtml @@ -1,20 +1,14 @@ -

    Listing game_genres

    +

    Listing Game Genres

    - <% for column in GameGenre.content_columns %> - - <% end %> + <% for game_genre in @game_genres %> - <% for column in GameGenre.content_columns %> - - <% end %> - + - <% end %>
    <%= column.human_name %>Name
    <%=h game_genre.send(column.name) %><%= link_to 'Show', :action => 'show', :id => game_genre %><%= link_to game_genre.name.to_s, :action => 'show', :id => game_genre %> <%= link_to 'Edit', :action => 'edit', :id => game_genre %><%= link_to 'Destroy', { :action => 'destroy', :id => game_genre }, :confirm => 'Are you sure?', :method => :post %>
    @@ -24,4 +18,4 @@
    -<%= link_to 'New game_genre', :action => 'new' %> +<%= link_to 'Add a New Game Genre', :action => 'new' %> diff --git a/db/development.sqlite3 b/db/development.sqlite3 index ce9e0e6ba6ab398ead666460386dd03fa7329e73..3ec86a675ef0ac4687c480c8f5e1ff9a77d9b057 100644 GIT binary patch delta 56 zcmV-80LTA;@Bx7E0gxL3+_4