Sha256: 9883061bf5d147e13fbd929006887a014486f4e137a15fc2d04e2725427179bd

Contents?: true

Size: 544 Bytes

Versions: 5

Compression:

Stored size: 544 Bytes

Contents

module Lookbook
  module PreviewController
    def render_component_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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lookbook-0.2.4 lib/lookbook/preview_controller.rb
lookbook-0.2.3 lib/lookbook/preview_controller.rb
lookbook-0.2.2 lib/lookbook/preview_controller.rb
lookbook-0.2.1 lib/lookbook/preview_controller.rb
lookbook-0.2.0 lib/lookbook/preview_controller.rb