Hi Fred,
thanks for answered.
So, I have this code generated:
<div id="invoice_items">
<div class="invoice_item">
<label for="invoice_items_attributes__item">item</label>
<input id="invoice_items_attributes__item" type="text" size="30"
name="invoice[items_attributes][][item]"/>
<label for="invoice_items_attributes__quantity">quantity</label>
<input id="invoice_items_attributes__quantity" type="text" size="30"
name="invoice[items_attributes][][quantity]"/>
<label for="invoice_items_attributes__price">Price</label>
<input id="invoice_items_attributes__price" type="text" size="30"
name="invoice[items_attributes][][price]"/>
<a onclick="this.up('.invoice_item').remove(); return false;"
href="#">remover</a>
</div>
<div class="invoice_item">
<label for="invoice_items_attributes__item">item</label>
<input id="invoice_items_attributes__item" type="text" size="30"
name="invoice[items_attributes][][item]"/>
<label for="invoice_items_attributes__quantity">quantity</label>
<input id="invoice_items_attributes__quantity" type="text" size="30"
name="invoice[items_attributes][][quantity]"/>
<label for="invoice_items_attributes__price">Price</label>
<input id="invoice_items_attributes__price" type="text" size="30"
name="invoice[items_attributes][][price]"/>
<a onclick="this.up('.invoice_item').remove(); return false;"
href="#">remover</a>
</div>
<div class="invoice_item">
<label for="invoice_items_attributes__item">item</label>
<input id="invoice_items_attributes__item" type="text" size="30"
name="invoice[items_attributes][][item]"/>
<label for="invoice_items_attributes__quantity">quantity</label>
<input id="invoice_items_attributes__quantity" type="text" size="30"
name="invoice[items_attributes][][quantity]"/>
<label for="invoice_items_attributes__price">Price</label>
<input id="invoice_items_attributes__price" type="text" size="30"
name="invoice[items_attributes][][price]"/>
<a onclick="this.up('.invoice_item').remove(); return false;"
href="#">remover</a>
</div>
<div class="invoice_item">
<label for="invoice_items_attributes__item">item</label>
<input id="invoice_items_attributes__item" type="text" size="30"
name="invoice[items_attributes][][item]"/>
<label for="invoice_items_attributes__quantity">quantity</label>
<input id="invoice_items_attributes__quantity" type="text" size="30"
name="invoice[items_attributes][][quantity]"/>
<label for="invoice_items_attributes__price">Price</label>
<input id="invoice_items_attributes__price" type="text" size="30"
name="invoice[items_attributes][][price]"/>
<a onclick="this.up('.invoice_item').remove(); return false;"
href="#">remover</a>
</div>
</div>
Or you can see the code here: http://pastie.org/339225
The question is: Should this input(<input
id="invoice_items_attributes__item" type="text" size="30"
name="invoice[items_attributes][][item]"/>) have a id different from the
other ones? I'm using a partial (partial code: http://pastie.org/334967)
to render this output. What should I do?
Sorry for all those question, but I'm a little noobe, and I have
exhausted all other sources that I now.
Thanks,
David Sousa
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---