lib/phlex/renderable.rb in phlex-0.2.0 vs lib/phlex/renderable.rb in phlex-0.2.1
- old
+ new
@@ -7,10 +7,10 @@
if block_given? && !block.binding.receiver.is_a?(Phlex::Block)
block = Phlex::Block.new(self, &block)
end
renderable.call(@_target, view_context: @_view_context, parent: self, &block)
- elsif renderable < Component
+ elsif renderable.is_a?(Class) && renderable < Component
raise ArgumentError, "You tried to render the Phlex component class: #{renderable.name} but you probably meant to render an instance of that class instead."
else
@_target << @_view_context.render(renderable, *args, **kwargs, &block)
end