Skip to content

Commit f5ba5bb

Browse files
authored
Move up
1 parent d604797 commit f5ba5bb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/jbuilder/jbuilder_template.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,20 +141,20 @@ def _render_partial_with_options(options)
141141
options.reverse_merge! ::JbuilderTemplate.template_lookup_options
142142
as = options[:as]
143143

144+
if options.has_key?(:layout)
145+
::Kernel.raise ::NotImplementedError, "The `:layout' option is not supported in collection rendering."
146+
end
147+
148+
if options.has_key?(:spacer_template)
149+
::Kernel.raise ::NotImplementedError, "The `:spacer_template' option is not supported in collection rendering."
150+
end
151+
144152
if as && options.key?(:collection) && CollectionRenderer.supported?
145153
collection = options.delete(:collection) || []
146154
partial = options.delete(:partial)
147155
options[:locals].merge!(json: self)
148156
collection = EnumerableCompat.new(collection) if collection.respond_to?(:count) && !collection.respond_to?(:size)
149157

150-
if options.has_key?(:layout)
151-
::Kernel.raise ::NotImplementedError, "The `:layout' option is not supported in collection rendering."
152-
end
153-
154-
if options.has_key?(:spacer_template)
155-
::Kernel.raise ::NotImplementedError, "The `:spacer_template' option is not supported in collection rendering."
156-
end
157-
158158
if collection.present?
159159
if options.has_key?(:layout)
160160
raise ::NotImplementedError, "The `:layout' option is not supported in collection rendering."

0 commit comments

Comments
 (0)