Sha256: 96080b8526d96f36f01951409547db1c3d6507ce79f51a8a47e46be81d1296f0

Contents?: true

Size: 757 Bytes

Versions: 16

Compression:

Stored size: 757 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(template, locals, layout = nil)
      append_view_path Lookbook::Engine.root.join("app/views")
      render_to_string template, locals: locals, **determine_layout(layout)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lookbook-0.7.2.beta.3 lib/lookbook/preview_controller.rb
lookbook-0.7.2.beta.2 lib/lookbook/preview_controller.rb
lookbook-0.7.2.beta.1 lib/lookbook/preview_controller.rb
lookbook-0.7.2.beta.0 lib/lookbook/preview_controller.rb
lookbook-0.7.1 lib/lookbook/preview_controller.rb
lookbook-0.7.0 lib/lookbook/preview_controller.rb
lookbook-0.6.1 lib/lookbook/preview_controller.rb
lookbook-0.6.0 lib/lookbook/preview_controller.rb
lookbook-0.5.2 lib/lookbook/preview_controller.rb
lookbook-0.5.1 lib/lookbook/preview_controller.rb
lookbook-0.5.0 lib/lookbook/preview_controller.rb
lookbook-0.5.0.beta.2 lib/lookbook/preview_controller.rb
lookbook-0.5.0.beta.1 lib/lookbook/preview_controller.rb
lookbook-0.5.0.beta.0 lib/lookbook/preview_controller.rb
lookbook-0.4.8 lib/lookbook/preview_controller.rb
lookbook-0.4.7 lib/lookbook/preview_controller.rb