lib/pagelet_rails/concerns/placeholder.rb in pagelet_rails-0.1.3 vs lib/pagelet_rails/concerns/placeholder.rb in pagelet_rails-0.1.4

- old
+ new

@@ -21,15 +21,23 @@ return unless render_remotely data = params.deep_dup data.permit! - if pagelet_options.remote != :stream - pagelet_options html: { 'data-widget-url' => url_for(data) } - end + if pagelet_options.remote == :ssi + path = url_for data.merge( + only_path: true, + original_pagelet_options: pagelet_encoded_original_options + ) + render body: "<!--#include virtual=\"#{path}\" -->" + else + if pagelet_options.remote != :stream + pagelet_options html: { 'data-widget-url' => url_for(data) } + end - default_view = '/layouts/pagelet_rails/loading_placeholder' - view = pagelet_options.placeholder.try(:[], :view).presence || default_view + default_view = '/layouts/pagelet_rails/loading_placeholder' + view = pagelet_options.placeholder.try(:[], :view).presence || default_view - render view + render view + end end end