Sha256: 43427e350050179ceb6873190a819598a4327051f2402cac45d9d9b52615000d

Contents?: true

Size: 745 Bytes

Versions: 11

Compression:

Stored size: 745 Bytes

Contents

module Lookbook
  module PreviewController
    def render_example_to_string(preview, example_name)
      prepend_application_view_paths
      prepend_preview_examples_view_path
      @preview = preview
      @example_name = example_name
      @render_args = @preview.render_args(@example_name, params: params.permit!)
      template = @render_args[:template]
      locals = @render_args[:locals]
      opts = {}
      opts[:layout] = nil
      opts[:locals] = locals if locals.present?
      render_to_string template, opts
    end

    def render_in_layout_to_string(content, layout_override)
      layout = determine_layout(layout_override, prepend_views: false)[:layout]
      render_to_string html: content, layout: layout
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lookbook-0.3.5 lib/lookbook/preview_controller.rb
lookbook-0.4.0.beta.2 lib/lookbook/preview_controller.rb
lookbook-0.4.0.beta.1 lib/lookbook/preview_controller.rb
lookbook-0.3.4 lib/lookbook/preview_controller.rb
lookbook-0.3.3 lib/lookbook/preview_controller.rb
lookbook-0.3.2 lib/lookbook/preview_controller.rb
lookbook-0.3.1 lib/lookbook/preview_controller.rb
lookbook-0.3.0 lib/lookbook/preview_controller.rb
lookbook-0.3.0.beta.2 lib/lookbook/preview_controller.rb
lookbook-0.3.0.beta.1 lib/lookbook/preview_controller.rb
lookbook-0.3.0.beta.0 lib/lookbook/preview_controller.rb