From: Ira W. Snyder Date: Mon, 26 Nov 2007 22:52:59 +0000 (-0800) Subject: Add GamePlatform to Game pages X-Git-Tag: turned-in~20 X-Git-Url: https://www.irasnyder.com/gitweb/?p=cs356-p2-videostore.git;a=commitdiff_plain;h=1400058ff6cb035111e5c2dfab0fd4ad7e44710d Add GamePlatform to Game pages Signed-off-by: Ira W. Snyder --- diff --git a/app/controllers/game_platform_controller.rb b/app/controllers/game_platform_controller.rb index 155bf97..49bf616 100644 --- a/app/controllers/game_platform_controller.rb +++ b/app/controllers/game_platform_controller.rb @@ -1,4 +1,6 @@ class GamePlatformController < ApplicationController + layout "admin" + def index list render :action => 'list' diff --git a/app/views/game/index.rhtml b/app/views/game/index.rhtml index c7c03d6..e6a4cf8 100644 --- a/app/views/game/index.rhtml +++ b/app/views/game/index.rhtml @@ -8,4 +8,7 @@
  • <%= link_to 'List All Game Genres', :controller => 'game_genre', :action => 'list' %>
  • <%= link_to 'Add a New Game Genre', :controller => 'game_genre', :action => 'new' %>
  • +
    +
  • <%= link_to 'List All Game Platforms', :controller => 'game_platform', :action => 'list' %>
  • +
  • <%= link_to 'Add a New Game Platform', :controller => 'game_platform', :action => 'new' %>
  • diff --git a/app/views/game_platform/edit.rhtml b/app/views/game_platform/edit.rhtml index 237e1d5..bbd88cc 100644 --- a/app/views/game_platform/edit.rhtml +++ b/app/views/game_platform/edit.rhtml @@ -1,4 +1,4 @@ -

    Editing game_platform

    +

    Editing Game Platform

    <% form_tag :action => 'update', :id => @game_platform do %> <%= render :partial => 'form' %> diff --git a/app/views/game_platform/list.rhtml b/app/views/game_platform/list.rhtml index 3206a36..9323f6f 100644 --- a/app/views/game_platform/list.rhtml +++ b/app/views/game_platform/list.rhtml @@ -1,20 +1,14 @@ -

    Listing game_platforms

    +

    Listing Game Platforms

    - +
    - <% for column in GamePlatform.content_columns %> - - <% end %> + <% for game_platform in @game_platforms %> - <% for column in GamePlatform.content_columns %> - - <% end %> - + - <% end %>
    <%= column.human_name %>Name
    <%=h game_platform.send(column.name) %><%= link_to 'Show', :action => 'show', :id => game_platform %><%= link_to game_platform.name.to_s, :action => 'show', :id => game_platform %> <%= link_to 'Edit', :action => 'edit', :id => game_platform %><%= link_to 'Destroy', { :action => 'destroy', :id => game_platform }, :confirm => 'Are you sure?', :method => :post %>
    @@ -24,4 +18,4 @@
    -<%= link_to 'New game_platform', :action => 'new' %> +<%= link_to 'New Game Platform', :action => 'new' %> diff --git a/app/views/game_platform/new.rhtml b/app/views/game_platform/new.rhtml index fdc286d..03f24b9 100644 --- a/app/views/game_platform/new.rhtml +++ b/app/views/game_platform/new.rhtml @@ -1,4 +1,4 @@ -

    New game_platform

    +

    New Game Platform

    <% form_tag :action => 'create' do %> <%= render :partial => 'form' %> diff --git a/db/development.sqlite3 b/db/development.sqlite3 index 3ec86a6..237d41e 100644 Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ