I have a form where the user can view a list of line items that has
description (read only) and quantity (input field). Can someone please
give me pointers on how to allow users to enter the quantity for the
line items they want and save it in the database? I also need to
validate to make sure that they enter integers only. TIA.
On 2 Lip, 20:38, “[email protected]” [email protected] wrote:
I have a form where the user can view a list of line items that has
description (read only) and quantity (input field). Can someone please
give me pointers on how to allow users to enter the quantity for the
line items they want and save it in the database? I also need to
validate to make sure that they enter integers only. TIA.
Check this tutorial:
(the whole series is really great).
Basically you can do something like:
@models = Model.update([array_of_ids], [{:attribute =>
value_for_first_object}, {:attribute => value_for_second_object},…])
Then you can iterate over @models to check for errors on returned
objects.