Ruby on Rails Monday, August 1, 2011

No reason.  It can be whatever number of times you decide.  If you want to show the user a form with 10 delivery items, then it would be 10.times.

On Mon, Aug 1, 2011 at 1:30 PM, Mauro <mrsanna1@gmail.com> wrote:
On 1 August 2011 12:20, Chris Kottom <chris@chriskottom.com> wrote:
> Never used simple_form, but I'd try it like this.  Forgive me if the syntax
> isn't quite right.
> controller:
>
> def show
>
>   @customer = Customer.find(params[:id])
>   @delivery = @customer.deliveries.build
>
>   3.times { @delivery.delivery_items.build }ù

why 3.times?

--
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