Add VideoGenres to the system
authorIra W. Snyder <devel@irasnyder.com>
Mon, 26 Nov 2007 22:42:07 +0000 (14:42 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Mon, 26 Nov 2007 22:42:07 +0000 (14:42 -0800)
Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
app/controllers/video_genre_controller.rb
app/views/video/index.rhtml
app/views/video_genre/edit.rhtml
app/views/video_genre/list.rhtml
app/views/video_genre/new.rhtml

index 6fe0d8f..5ec3ea9 100644 (file)
@@ -1,4 +1,6 @@
 class VideoGenreController < ApplicationController
+  layout "admin"
+
   def index
     list
     render :action => 'list'
index 3256908..838567b 100644 (file)
@@ -5,4 +5,7 @@
   <li><%= link_to 'List All Videos', :action => 'list' %></li>
   <li><%= link_to 'Search for a Video', :action => 'search' %></li>
   <li><%= link_to 'Add a New Video', :action => 'new' %></li>
+  <br/>
+  <li><%= link_to 'List All Video Genres', :controller => 'video_genre', :action => 'list' %></li>
+  <li><%= link_to 'Add a New Video Genre', :controller => 'video_genre', :action => 'new' %></li>
 </ul>
index 9d45a13..f40f9ea 100644 (file)
@@ -1,4 +1,4 @@
-<h1>Editing video_genre</h1>
+<h1>Editing Video Genre</h1>
 
 <% form_tag :action => 'update', :id => @video_genre do %>
   <%= render :partial => 'form' %>
index 2e64727..e918ec5 100644 (file)
@@ -1,20 +1,14 @@
-<h1>Listing video_genres</h1>
+<h1>Listing Video Genres</h1>
 
-<table>
+<table border="1">
   <tr>
-  <% for column in VideoGenre.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
+    <th>Name</th>
   </tr>
   
 <% for video_genre in @video_genres %>
   <tr>
-  <% for column in VideoGenre.content_columns %>
-    <td><%=h video_genre.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'Show', :action => 'show', :id => video_genre %></td>
+    <td><%= link_to video_genre.name, :action => 'show', :id => video_genre %></td>
     <td><%= link_to 'Edit', :action => 'edit', :id => video_genre %></td>
-    <td><%= link_to 'Destroy', { :action => 'destroy', :id => video_genre }, :confirm => 'Are you sure?', :method => :post %></td>
   </tr>
 <% end %>
 </table>
index 8624080..950c3bd 100644 (file)
@@ -1,4 +1,4 @@
-<h1>New video_genre</h1>
+<h1>New Video Genre</h1>
 
 <% form_tag :action => 'create' do %>
   <%= render :partial => 'form' %>