2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'app/helpers/admin/regions_helper.rb', line 2
def render_region(region, options = {}, &block)
lazy_initialize_region_set
default_partials = TrustyCms::AdminUI::RegionPartials.new(self)
if block_given?
block.call(default_partials)
(options[:locals] ||= {}).merge!(defaults: default_partials)
end
output = @region_set[region].compact.map do |partial|
begin
render options.merge(partial: partial)
rescue ::ActionView::MissingTemplate default_partials[partial]
rescue ::ActionView::TemplateError => e raise e
end
end.join.html_safe
Rails.logger.error(output)
block_given? ? concat(output) : output
end
|