lib/avo/resources/items/holder.rb in avo-3.0.0.pre3 vs lib/avo/resources/items/holder.rb in avo-3.0.0.pre4

- old
+ new

@@ -27,12 +27,16 @@ end add_item field_parser.instance end - def tabs(instance) - add_item instance + def tabs(tab = nil, **kwargs, &block) + if tab.present? + add_item tab + else + add_item Avo::Resources::Items::TabGroup::Builder.parse_block(**kwargs, &block) + end end def tab(name, **args, &block) add_item Avo::Resources::Items::Tab::Builder.parse_block(name: name, **args, &block) end @@ -52,11 +56,11 @@ field = Avo::Fields::HeadingField.new(body, **args) add_item field end - def sidebar(instance) - add_item instance + def sidebar(**args, &block) + add_item Avo::Resources::Items::Sidebar::Builder.parse_block(**args, &block) end def add_item(instance) @items << instance