Permalink
Browse files

Various small fixes to views, and defining @packages in the listings_…

…controller.
  • Loading branch information...
1 parent 97b9418 commit 7a97f8a6131e973f14115406912401442561ec3c @jvenator committed May 15, 2012
@@ -19,6 +19,7 @@ def show
@listing = current_user.listings.find(params[:id])
@documents = current_user.documents-@listing.documents
@shared_listings = @listing.shared_listings
+ @packages = @listing.packages
respond_to do |format|
format.html # show.html.erb
@@ -16,14 +16,12 @@
</tr>
</thead>
<tbody>
- <% @shared_listings.each do |sl| %>
- <% sl.packages.each do |p| %>
- <tr>
- <td><%= link_to p.user.full_name, package_path(p) %></td>
- <td><%= p.identifier %></td>
- <td><%= p.updated_at %></td>
- </tr>
- <% end %>
+ <% @packages.each do |p| %>
+ <tr>
+ <td><%= link_to p.user.full_name, package_path(p) %></td>
+ <td><%= p.identifier %></td>
+ <td><%= p.updated_at %></td>
+ </tr>
<% end %>
</tbody>
</table>
@@ -11,7 +11,7 @@
<div class="form-actions">
<%= f.submit nil, :class => 'btn btn-primary' %>
- <%= link_to 'Cancel', packages_path, :class => 'btn' %>
+ <%= link_to 'Cancel', root_path, :class => 'btn' %>
</div>
</fieldset>
<% end %>
@@ -2,7 +2,7 @@
<h3>
<%= @package.name %>
<% if @package.identifier.present? %>
- - (#<%= @package.identifier %>)
+ - (<%= @package.identifier %>)
<% end%>
</h3>
<div class="form-actions">
@@ -1,6 +1,6 @@
<p>
<h2>
- <%= @listing_user.first_name %> <%= @listing_user.last_name %> - <%= @shared_listing.listing.identifier %>
+ <%= @listing.name %> (<%= @shared_listing.listing.identifier %>)
</h2>
<div class="form-actions">
<%= link_to 'Dashboard', dashboard_path, :class => 'btn btn-mini btn-info' %>
View
@@ -85,20 +85,19 @@
t.integer "listing_id"
t.integer "sender_id"
t.string "receiver_email"
- t.string "listing_identifier"
- t.string "package_identifier"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "shared_packages", :force => true do |t|
t.string "receiver_type"
t.integer "receiver_id"
t.integer "package_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.integer "sender_id"
t.string "receiver_email"
+ t.string "listing_identifier"
end
create_table "submitted_packages", :force => true do |t|

0 comments on commit 7a97f8a

Please sign in to comment.