Permalink
Browse files

updating views to match schema

  • Loading branch information...
1 parent 5afb066 commit eae6513472151c94ebdd4fd8b0aa8691b9aadbd7 @chaserx chaserx committed Jul 7, 2012
Showing with 22 additions and 10 deletions.
  1. +1 −1 app/models/item.rb
  2. +2 −2 app/views/items/_form.html.erb
  3. +5 −5 app/views/items/index.html.erb
  4. +14 −2 app/views/items/show.html.erb
View
@@ -1,5 +1,5 @@
class Item < ActiveRecord::Base
- attr_accessible :checked_in, :checked_out, :checked_out_by, :date_collected, :name, :tag_number
+ attr_accessible :time_checked_in, :time_checked_out, :checked_out_by, :date_collected, :name, :tag_number, :type, :desc
validates :tag_number, uniqueness: true, allow_nil: true
@@ -6,8 +6,8 @@
<%= f.input :type %>
<%= f.input :desc %>
<%= f.input :date_collected %>
- <%= f.input :checked_in %>
- <%= f.input :checked_out %>
+ <%= f.input :time_checked_in %>
+ <%= f.input :time_checked_out %>
<%= f.input :checked_out_by %>
<%= f.input :tag_number %>
</div>
@@ -1,11 +1,11 @@
-<h1>Listing items</h1>
+<h1>Listing Items</h1>
<table>
<tr>
<th>Name</th>
<th>Date collected</th>
- <th>Checked in</th>
- <th>Checked out</th>
+ <th>Time Checked in</th>
+ <th>Time Checked out</th>
<th>Checked out by</th>
<th>Tag number</th>
<th></th>
@@ -17,8 +17,8 @@
<tr>
<td><%= item.name %></td>
<td><%= item.date_collected %></td>
- <td><%= item.checked_in %></td>
- <td><%= item.checked_out %></td>
+ <td><%= item.time_checked_in %></td>
+ <td><%= item.time_checked_out %></td>
<td><%= item.checked_out_by %></td>
<td><%= item.tag_number %></td>
<td><%= link_to 'Show', item %></td>
@@ -1,23 +1,35 @@
+<h2>Item Detail</h2>
<p id="notice"><%= notice %></p>
<p>
<b>Name:</b>
<%= @item.name %>
</p>
+<p>
+ <b>Desc:</b>
+ <%= @item.desc %>
+</p>
+
+<p>
+ <b>Type:</b>
+ <%= @item.type %>
+</p>
+
+
<p>
<b>Date collected:</b>
<%= @item.date_collected %>
</p>
<p>
<b>Checked in:</b>
- <%= @item.checked_in %>
+ <%= @item.time_checked_in %>
</p>
<p>
<b>Checked out:</b>
- <%= @item.checked_out %>
+ <%= @item.time_checked_out %>
</p>
<p>

0 comments on commit eae6513

Please sign in to comment.