Dear All,

Thanks for the kind lessons on how to add a page using script/runner. I
have the following working script to create such a new page:

# ------ start of script to add a new page ---

 parent = Page.find_by_url('/services/news')
   child = parent.children.build(:title => "Floods",
   :breadcrumb => "Floods", :slug => "floods") 
   child.parts.build(:content => "This is a page for flood news",
   :name    => "body")
   child.save!

# ------ end of script to add a new page ---

How may I update the contents using script/runner? I have tried
the following, but it does not work. Any help to solve this
would be much appreciated.

# ---- test script that does not work

 floods = Page.find_by_url('/services/news/floods')
   floods.parts.build(:content => "This is now for droughts")
   floods.update

thanks in advance,

saji

_______________________________________________
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