Search code examples
ruby-on-railsrefinerycms

RefineryCMS - Duplicate a page with page parts


I have created a page say 'tour' with few page parts in the admin. I want to make many more pages similar to the page created say 'tour1', 'tour2' etc. Is there a way to duplicate it than manually adding a page and its page part?

Hope am clear with my question.

Thanks in advance.


Solution

  • Duplicating Pages functionality doesn't currently exist in Refinery. But it isn't that difficult to add, I've done something similar for a custom engine I made where 'Events' had page parts and I let an admin duplicate them. In your case, just override the Pages controller and add a route/action for the copying. You can then create a new Page and add the page parts by copying the attributes over from the desired Page's parts. Does that make sense?