Thank you, this works... thanks to all who helped.
best wishes,
saji
* Adam Williams <[EMAIL PROTECTED]> [2007-05-16 06:49:54 -0400]:

> On May 16, 2007, at 5:16 AM, Francesco Lunelli wrote:
> 
> > Saji Njarackalazhikam Hameed ha scritto:
> >> Dear Dan,
> >>
> >> Thanks very much. I put child.parts as an array.
> >>      child.parts = [ body ]
> >>
> >> Now the error is while
> >> saving.
> >>
> >>        child.save!
> >>
> >> ...
> > I think it should be child.parts << body
> 
> I prefer the following, as it gives me the necessary associations of  
> things to one another. Perhaps the other code is failing as it is  
> missing the part name of "body"?
> 
> ----------
> require 'config/environment'
> 
> parent = Page.find_by_url('/request')
> 
> 50.times do |i|
>    child = parent.children.build(
>      :title => "Page #{i}",
>      :breadcrumb => "Page #{i}",
>      :slug => "page-#{i}")
>    child.parts.build(
>      :content => "This is page #{i}",
>      :name    => "body")
>    child.save!
> end
> _______________________________________________
> Radiant mailing list
> Post:   [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

-- 
Saji N. Hameed

APEC Climate Center                                     +82 51 668 7470
National Pension Corporation Busan Building 12F         
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705                 [EMAIL PROTECTED]
KOREA
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to