5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/controllers/kms/public/search_controller.rb', line 5
def search
results = Page.advanced_search(params[:query]).to_drop if params[:result_page] and @page = Page.find_by_fullpath(params[:result_page])
@externals = Hash[ExternalsRegistry.externals.map{ |k, v| [k, v.call(request, self)] }]
@template = @page.template
page_result = Rails.configuration.x.template_manager.render(@page.register_id, @externals.merge!(search: results))
result = Rails.configuration.x.template_manager.render(@template.register_id, @externals.merge(_inner_template: page_result))
render text: result, layout: false
else
redirect_to root_path
end
end
|