Created
August 24, 2013 11:49
-
-
Save siassaj/6327681 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= simple_form_for @machine_visit_form do |f| | |
= f.error_notification | |
= f.input :refill_id, as: :hidden | |
= f.input :refill_date, as: :date | |
= f.input :refill_counter, as: :decimal, input_html: {value: number_with_precision(f.object.refill_counter, precision: 2) } | |
- @machine_visit_form.refill_line_items.each_with_index do |rli, i| | |
.well | |
= "#{rli.product_name}" | |
= f.fields_for rli do |ff| | |
= ff.hidden_field :id | |
= ff.select :product, options_from_collection_for_select(Product.all, "id", "name") | |
= ff.number_field :quantity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="well"> | |
No Product<input id="refill_refill_line_item_id" name= | |
"refill[refill_line_item][id]" type="hidden" /><select id= | |
"refill_refill_line_item_product" name="refill[refill_line_item][product]"> | |
<option value="1"> | |
Mars Bar | |
</option> | |
</select><input id="refill_refill_line_item_quantity" name= | |
"refill[refill_line_item][quantity]" type="number" /> | |
</div> | |
<div class="well"> | |
No Product<input id="refill_refill_line_item_id" name= | |
"refill[refill_line_item][id]" type="hidden" /><select id= | |
"refill_refill_line_item_product" name="refill[refill_line_item][product]"> | |
<option value="1"> | |
Mars Bar | |
</option> | |
</select><input id="refill_refill_line_item_quantity" name= | |
"refill[refill_line_item][quantity]" type="number" /> | |
</div> | |
<div class="well"> | |
No Product<input id="refill_refill_line_item_id" name= | |
"refill[refill_line_item][id]" type="hidden" /><select id= | |
"refill_refill_line_item_product" name="refill[refill_line_item][product]"> | |
<option value="1"> | |
Mars Bar | |
</option> | |
</select><input id="refill_refill_line_item_quantity" name= | |
"refill[refill_line_item][quantity]" type="number" /> | |
</div><input class="btn btn-primary" name="commit" type="submit" value= | |
"Create Refill" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment