<% for product in Product.find(:all) -%> <% next if params[:action] == "new" && product.active == 0 -%> <% if @order && @order.has_item_with_product_id(product.id) -%> <% item = @order.line_item_with_product_id(product.id) -%> <% end -%> <% end -%>
<%= item.product.name -%> <%= text_field "items", item.product.id, :size => 4, :value => item.quantity %> $<%= text_field "item_prices", item.product.id, :size => 5, :value => item.unit_price %> <%= item.license_key -%> <% elsif product.active == 1 -%> <%= product.name %> <%= text_field "items", product.id, :size => 4 %> $<%= text_field "item_prices", product.id, :size => 5, :value => product.price %>