lib/lookbook/preview_controller.rb in lookbook-0.9.8 vs lib/lookbook/preview_controller.rb in lookbook-1.0.0.beta.0
- old
+ new
@@ -12,11 +12,15 @@
opts[:layout] = nil
opts[:locals] = locals if locals.present?
render html: render_to_string(template, **opts)
end
- def render_in_layout_to_string(template, locals, layout = nil)
+ def render_in_layout_to_string(template, locals, **opts)
append_view_path Lookbook::Engine.root.join("app/views")
- render html: render_to_string(template, locals: locals, **determine_layout(layout))
+ 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
end