Skip to content

Instantly share code, notes, and snippets.

@eladmeidar
Created August 25, 2009 16:47
Show Gist options
  • Save eladmeidar/174803 to your computer and use it in GitHub Desktop.
Save eladmeidar/174803 to your computer and use it in GitHub Desktop.
## source
<table class="table">
<thead>
<tr>
<th>Part Number</th>
<th style="width:70px;">Quantity</th>
<th>Condition</th>
<th style="width:70px;">Price</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><input class="text_field" id="quote_quote_items_attributes_0_pn" name="quote[quote_items_attributes][0][pn]" size="30" type="text" /></td>
<td><input class="text_field" id="quote_quote_items_attributes_0_quantity" name="quote[quote_items_attributes][0][quantity]" size="30" type="text" /></td>
<td><select id="quote_quote_items_attributes_0_condition_id" name="quote[quote_items_attributes][0][condition_id]"><option value="1">OH</option>
<option value="2">FN</option>
<option value="3">NS</option>
<option value="4">NE</option>
<option value="5">SV</option>
<option value="6">AR</option>
<option value="7">IN</option>
<option value="8">RP</option></select></td>
<td><input class="text_field" id="quote_quote_items_attributes_0_price_in_cents" name="quote[quote_items_attributes][0][price_in_cents]" size="30" type="text" /></td>
<td></td>
</tr>
<tr>
<td></td>
<td colspan="4" class="last"><a href="#">Add &raquo;</a></td>
</tr>
</tbody>
</table>
## ERB
<table class="table">
<thead>
<tr>
<th>Part Number</th>
<th style="width:70px;">Quantity</th>
<th>Condition</th>
<th style="width:70px;">Price</th>
<th></th>
</tr>
</thead>
<tbody>
<% f.fields_for :quote_items do |q| %>
<%= render :partial => 'quote_item', :locals => {:q => q}%>
<% end %>
<tr>
<td></td>
<td colspan="4" class="last"><a href="#">Add &raquo;</a></td>
</tr>
</tbody>
</table>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment