Skip to content

Instantly share code, notes, and snippets.

@seebq
Created June 22, 2011 14:53
Show Gist options
  • Save seebq/1040262 to your computer and use it in GitHub Desktop.
Save seebq/1040262 to your computer and use it in GitHub Desktop.
<p id="notice"><%= notice %></p>
<p>
<b>Name:</b>
<%= @order.name %>
</p>
<p>Order contains <%= @order.boxes.size %> boxes.</p>
<ul>
<% @order.boxes.each do |box| %>
<li>A <%= box.color %> <%= box.material %> box. <%= link_to 'Remove', remove_box_order_path(:id => @order.id, :box_id => box.id), :method => :delete %></li>
<% end %>
</ul>
<p><%= link_to 'Clear all Boxes', clear_boxes_order_path(:id => @order.id), :method => :delete %></p>
<p>Add a box to this order:</p>
<%= form_tag :action => 'add_box', :id => @order.id do %> <label for="box_order">Box</label><br/> <%= select_tag 'box_id',
options_for_select(Box.find(:all).collect { |b| [ b.color, b.id ] }) %>
<%= submit_tag 'Add Box' %>
<% end %>
<%= link_to 'Edit', edit_order_path(@order) %> |
<%= link_to 'Back', orders_path %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment