title: Twig one to many relations
body: <p>I am new to Twig. I thought I had mastered the basics but am completely stuck on this.</p>
  
  <p>I have two arrays:</p>
  
  <pre><code>books =&gt; [
               [
                   'book_id' =&gt; ...,
                   'book_title' =&gt; ...,
               ],
           ],  
  </code></pre>
  
  <p>and   </p>
  
  <pre><code>tags =&gt; [
               [
                   'tag_id' =&gt; ...,
                   'book_id' =&gt; ...,
                   'tag'     =&gt; ...,
               ],
           ],  
  </code></pre>
  
  <p>How do I get Twig to produce something along these lines</p>
  
  <blockquote>
    <p>Book title 1   tag1 tag2 tag3 tag5</p>
    
    <p>Book title 2   tag1 tag3 tag4 tag2</p>
  </blockquote>
  
  <p>and so on</p>
  
  <p>So far I have</p>
  
  <pre><code>{% for book in books %}
      {{book.title}} 
      {% for tag in tags %}
  
  what goes here to get a list of tags for this book
  
      {%endfor%}  
  {% endfor %}
  </code></pre>
  
  <p>I know it is only a few lines of code but I don’t know where to start
  A  hint in the right direction would be really appreciated.</p>