Sha256: 330e96dd996f78fdacad60711247b3488c2f91b5b07195852a189f3555058fbe
Contents?: true
Size: 739 Bytes
Versions: 5
Compression:
Stored size: 739 Bytes
Contents
# frozen_string_literal: true require 'action_view/renderer/collection_renderer' class Pbbuilder class CollectionRenderer < ::ActionView::CollectionRenderer # :nodoc: def initialize(lookup_context, options, &scope) super(lookup_context, options) @scope = scope end private def build_rendered_template(content, template, layout = nil) super(content || pb.attributes!, template) end def build_rendered_collection(templates, _spacer) pb_parent.set!(field, templates.map(&:body)) end def pb @options[:locals].fetch(:pb) end def pb_parent @options[:locals].fetch(:pb_parent) end def field @options[:locals].fetch(:field).to_s end end end
Version data entries
5 entries across 5 versions & 1 rubygems