opal/lissio/component/container.rb in lissio-0.1.0.beta3 vs opal/lissio/component/container.rb in lissio-0.1.0
- old
+ new
@@ -19,13 +19,11 @@
def to_a
@list
end
end
- def initialize(parent, &block)
- super(parent)
-
+ def initialize(&block)
if block
@content = Definer.new(&block).to_a
else
@content = []
end
@@ -36,13 +34,13 @@
content.compact! # FIXME: when it's fixed
element.clear
content.each {|c|
- if String === c
- element << c
- else
+ if Component === c
element << c.render
+ else
+ element << c.to_s
end
}
if block
element << DOM(&block)