From: Ira W. Snyder Date: Mon, 26 Nov 2007 22:48:18 +0000 (-0800) Subject: Add GameGenres to the Games page X-Git-Tag: turned-in~21 X-Git-Url: https://www.irasnyder.com/gitweb/?a=commitdiff_plain;h=49780de1e4382884d99126b3d48f5ad232deb91e;p=cs356-p2-videostore.git Add GameGenres to the Games page Signed-off-by: Ira W. Snyder --- 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 ce9e0e6..3ec86a6 100644 Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ