title: Inlined array elements with JBuilder
body: <p>How do you create an array with elements in it using Jbuilder without setting it to a variable first?</p>
  
  <p>I want to end up with the following while using JBuilder</p>
  
  <pre><code>{
    "something": [
      { "name": "first", "foo": "bar"},
      { "name": "second", "foo": "baz"}
    ]
  }
  </code></pre>
  
  <p>The only method I have found that works is the following.</p>
  
  <pre><code>json.something do
    something = [
      { name: 'first', foo: 'bar' },
      { name: 'second', foo: 'baz' }
    ]
    json.array! something do |item|
      json.(item, :name, :foo)
    end
  end
  </code></pre>
  
  <p>Is there a way to make it look more like this?</p>
  
  <pre><code>json.array! 'something' do
    json.array do
      json.name 'first'
      json.foo 'bar'
    end
    json.array do
      json.name 'second'
      json.foo 'baz'
    end
  end
  </code></pre>