Fabian asked:

How do subelements work?

13:39 < Vagabond> speaking of element, gmosx: can you explain the use of subelements?

13:40 < zimba-tm> Vagabond: you’re talking of @_childs ?
13:40 < zimba-tm> hmm i’m interested too

(1 attempts)

Fabian answered:

In templates for example:

<Container>
    ...
    <Sidebar>
      ...
    </Sidebar>
  </Container>

then in container element:

class Container < Nitro::Element
  def render
    %{
      ...
      #{content :sidebar}
    }
  end
end

and a sidebar element:

class Sidebar < Nitro::Element
  def render 
    ... 
  end
end

13:43 < gmosx> and this gets interpolated in Container...

Rating: 4