Hi Rob,
Thanks for that, it looks perfect, but I can't get it to work. I'm not very familiar with the rails console, but it seems to be a syntax problem? Possibly because I'm using Rails 3.6.2 ?
1.8.7 :063 > Refinery::Page.all.map do {|p| p.parts.create(:title => "Side Quote 1", :position => 4) }1.8.7 :064?> And then nothing happens...so I'm guessing that ? appended means there was an error.
My poking around makes me think the parts object doesn't exist for my page objects - but obviously this can't be the case as I have existing page-parts.
This is the output I get when listing properties of one of the pages:
1.8.7 :061 > Refinery::Page.last Refinery::Page Load (1.0ms) SELECT "refinery_pages".* FROM "refinery_pages" ORDER BY "refinery_pages"."id" DESC LIMIT 1 Refinery::Page::Translation Load (0.8ms) SELECT "refinery_page_translations".* FROM "refinery_page_translations" WHERE "refinery_page_translations"."refinery_page_id" = 39 => #<Refinery::Page id: 39, parent_id: 36, path: nil, slug: "third-level-3", show_in_menu: true, link_url: "", menu_match: nil, deletable: true, draft: false,
skip_to_first_child: false, lft: 22, rgt: 23, depth: 3, view_template: nil, layout_template: nil, created_at: "2012-07-26 09:16:55", updated_at: "2012-07-26 09:16:55"> Any idea what have I done wrong?
Thanks,
Patrick
On Tuesday, July 31, 2012 1:37:24 PM UTC+1, Rob Yurkowski wrote:
Hey, Patrick,
This ought to address it.
On 2012-07-31, at 6:51 AM, Peaceand wrote:
Hi,
I've got a nice site set up and working on Refinery 2-0-stable, but my design has changed slightly and I want to include a new page-part on every page.
Now I could do this manually through the web interface, but there are >70 pages full of content.
Does anybody have a suggestion for how to automate this? It's just a one-off process so it doesn't have to be elegant!
I've already edited the pages.rb initializer, so the new page-parts will be included on all new pages.
Thanks in advance,
Patrick
--
You received this message because you are subscribed to the Google
Groups "Refinery CMS" group.
To post to this group, send email to refine...@googlegroups.com
To unsubscribe from this group, send email to