How to create page in refinery via code

      page = Page.create(
        :title => 'Testpage',
        :link_url => '/testpath',
        :deletable => false,
        :position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
        :menu_match => '^/testpath(\/|\/.+?|)$'
      )
      Page.default_parts.each do |default_page_part|
        page.parts.create(:title => default_page_part, :body => nil)
      end
    5
    Average: 5 (1 vote)