module Lookbook::PreviewControllerActions

def render_in_layout_to_string(template, locals, opts = {})

def render_in_layout_to_string(template, locals, opts = {})
  with_action_view_settings do
    html = render_to_string(template, locals: locals, **determine_layout(opts[:layout]))
    if opts[:append_html].present?
      html += opts[:append_html]
    end
    render html: html
  end
end