Ruby on Rails Sunday, July 31, 2011

On 31 July 2011 22:52, Conrad Taylor <conradwt@gmail.com> wrote:
> On Sun, Jul 31, 2011 at 1:47 PM, Conrad Taylor <conradwt@gmail.com> wrote:
>>
>> On Sun, Jul 31, 2011 at 11:12 AM, Mauro <mrsanna1@gmail.com> wrote:
>>>
>>> On 30 July 2011 21:22, Mauro <mrsanna1@gmail.com> wrote:
>>> > https://gist.github.com/1114858.
>>> > How can I set the quantity DeliveryItem in the same form so that when
>>> > I update the customer attributes the Delivery is created with products
>>> > and their quantity?
>>> >
>>>
>>> no solution?
>>>
>>
>> Mauro, I'm not 100% sure what you're trying to ask here.  Thus, could you
>> explain
>> the steps starting with how the user would interact with the form to
>> what you would
>> like to happen?  For example,
>> a)  The user navigates to the page containing the form.
>> b)  The user does X
>> c)  ...

Ok, sorry but my english is really bad..........
Then, as you see in the code the Customer has many deliveries and one
Delivery has many products through delivery_items.
I want to do this: I call the show action for Customer;
I view customer details and a form to create a delivery for that customer.
The delivery has one or more products.
When I submit the form it creates the delivery for the customer with
one or more delivery_items, that is the join model.
The delivery_item contains the product but the quantity attribute is
nil, I want to populate the quantity when the delivery was created so
that the delivery has products with their quantity.
>
> Or do you have tests which might add some clarity to what you're trying to
> achieve?
>
>>
>> -Conrad
>>
>>>
>>> --
>>> 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 rubyonrails-talk@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> rubyonrails-talk+unsubscribe@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>>
>>
>
> --
> 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 rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment