lib/action_view/component/monkey_patch.rb in actionview-component-1.5.3 vs lib/action_view/component/monkey_patch.rb in actionview-component-1.6.0

- old
+ new

@@ -15,9 +15,11 @@ options.render_in(self, &block) elsif options.is_a?(Class) && options < ActionView::Component::Base options.new(args).render_in(self, &block) elsif options.is_a?(Hash) && options.has_key?(:component) options[:component].new(options[:locals]).render_in(self, &block) + elsif options.respond_to?(:to_component_class) && !options.to_component_class.nil? + options.to_component_class.new(options).render_in(self, &block) else super end end end