module ActionView
module Helpers
module NestedLayoutsHelper
def inside_layout(layout, &block)
layout = layout.to_s
layout = layout.include?('/') ? layout : "layouts/#{layout}"
@template.instance_variable_set('@content_for_layout', capture(&block))
concat(
@template.render(:file => layout, :use_full_path => true)
)
end
def inside_inline_layout(template_content, &block)
@template.instance_variable_set('@content_for_layout', capture(&block))
concat(@template.render(:inline => template_content))
end
end
end
end