Sha256: 6afa3ddc6cb46d8a01787a0f2eb9c41dc92bd6fc980770aa1f5b7fc6ae385087

Contents?: true

Size: 468 Bytes

Versions: 15

Compression:

Stored size: 468 Bytes

Contents

module TemplateRendererExtension
  private

  def render_template(template, layout_name = nil, *args)
    if layout_name && bootstrap?(template)
      layout_name = 'layouts/shipit_bootstrap'
    end
    super(template, layout_name, *args)
  end

  def bootstrap?(template)
    template.identifier.start_with?('bootstrap/') || template.identifier.start_with?("#{Shipit.bootstrap_view_path}/")
  end
end

ActionView::TemplateRenderer.prepend(TemplateRendererExtension)

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
shipit-engine-0.20.1 lib/shipit/template_renderer_extension.rb
shipit-engine-0.20.0 lib/shipit/template_renderer_extension.rb
shipit-engine-0.19.0 lib/shipit/template_renderer_extension.rb
shipit-engine-0.18.1 lib/shipit/template_renderer_extension.rb
shipit-engine-0.18.0 lib/shipit/template_renderer_extension.rb
shipit-engine-0.17.0 lib/shipit/template_renderer_extension.rb
shipit-engine-0.16.0 lib/shipit/template_renderer_extension.rb
shipit-engine-0.15.0 lib/shipit/template_renderer_extension.rb
shipit-engine-0.14.0 lib/shipit/template_renderer_extension.rb
shipit-engine-0.13.0 lib/shipit/template_renderer_extension.rb
shipit-engine-0.12.1 lib/shipit/template_renderer_extension.rb
shipit-engine-0.12.0 lib/shipit/template_renderer_extension.rb
shipit-engine-0.11.0 lib/shipit/template_renderer_extension.rb
shipit-engine-0.10.0 lib/shipit/template_renderer_extension.rb
shipit-engine-0.9.0 lib/shipit/template_renderer_extension.rb