paperculture/alchemy_cms — pull request #4 by rwong48 (2014-06-11 19:56:53+00:00)
Title: Add ability to control which layout a page is rendered with, using a new definition in page_layouts.

This is the initial implementation. It might not be the best way to do things. Comments are requested.

For pages, we have a new PERMITTED_ATTRIBUTE 'render_layout', which allows us to define a layout to render the page with. Our use case for this is to render certain pages with a layout that's not the 'application' layout.

In the pages controller, if the request is not an XHR, we check to see if the page has a defined render_layout. If so, we get the render_layout, and call render with the render_layout. If not, we just do whatever we did before.

natures.rb contains utility methods for page_layouts, so I've added utility functions 'has_render_layout' and 'render_layout' there.