From d9ccb8cf52aee119343545cb734e185580daf352 Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Mon, 26 Nov 2007 14:42:07 -0800 Subject: [PATCH] Add VideoGenres to the system Signed-off-by: Ira W. Snyder --- app/controllers/video_genre_controller.rb | 2 ++ app/views/video/index.rhtml | 3 +++ app/views/video_genre/edit.rhtml | 2 +- app/views/video_genre/list.rhtml | 14 ++++---------- app/views/video_genre/new.rhtml | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/controllers/video_genre_controller.rb b/app/controllers/video_genre_controller.rb index 6fe0d8f..5ec3ea9 100644 --- a/app/controllers/video_genre_controller.rb +++ b/app/controllers/video_genre_controller.rb @@ -1,4 +1,6 @@ class VideoGenreController < ApplicationController + layout "admin" + def index list render :action => 'list' diff --git a/app/views/video/index.rhtml b/app/views/video/index.rhtml index 3256908..838567b 100644 --- a/app/views/video/index.rhtml +++ b/app/views/video/index.rhtml @@ -5,4 +5,7 @@
  • <%= link_to 'List All Videos', :action => 'list' %>
  • <%= link_to 'Search for a Video', :action => 'search' %>
  • <%= link_to 'Add a New Video', :action => 'new' %>
  • +
    +
  • <%= link_to 'List All Video Genres', :controller => 'video_genre', :action => 'list' %>
  • +
  • <%= link_to 'Add a New Video Genre', :controller => 'video_genre', :action => 'new' %>
  • diff --git a/app/views/video_genre/edit.rhtml b/app/views/video_genre/edit.rhtml index 9d45a13..f40f9ea 100644 --- a/app/views/video_genre/edit.rhtml +++ b/app/views/video_genre/edit.rhtml @@ -1,4 +1,4 @@ -

    Editing video_genre

    +

    Editing Video Genre

    <% form_tag :action => 'update', :id => @video_genre do %> <%= render :partial => 'form' %> diff --git a/app/views/video_genre/list.rhtml b/app/views/video_genre/list.rhtml index 2e64727..e918ec5 100644 --- a/app/views/video_genre/list.rhtml +++ b/app/views/video_genre/list.rhtml @@ -1,20 +1,14 @@ -

    Listing video_genres

    +

    Listing Video Genres

    - +
    - <% for column in VideoGenre.content_columns %> - - <% end %> + <% for video_genre in @video_genres %> - <% for column in VideoGenre.content_columns %> - - <% end %> - + - <% end %>
    <%= column.human_name %>Name
    <%=h video_genre.send(column.name) %><%= link_to 'Show', :action => 'show', :id => video_genre %><%= link_to video_genre.name, :action => 'show', :id => video_genre %> <%= link_to 'Edit', :action => 'edit', :id => video_genre %><%= link_to 'Destroy', { :action => 'destroy', :id => video_genre }, :confirm => 'Are you sure?', :method => :post %>
    diff --git a/app/views/video_genre/new.rhtml b/app/views/video_genre/new.rhtml index 8624080..950c3bd 100644 --- a/app/views/video_genre/new.rhtml +++ b/app/views/video_genre/new.rhtml @@ -1,4 +1,4 @@ -

    New video_genre

    +

    New Video Genre

    <% form_tag :action => 'create' do %> <%= render :partial => 'form' %> -- 2.25.1