title: Generate form for array with hashes with formtastic
body: <p>I'm having difficulty with formtastic. I'll first try to sketch the situation as good as I can.</p>
  
  <p>I have a model named <code>onlinescore</code> which has attributes <code>publisher</code>, <code>id</code>, and some other basic ones. One of its attributes however is an array with <code>urls</code>. Those <code>urls</code> are hashes with content like this:</p>
  
  <pre><code>{"url" =&gt; "http://www.example.com", "description" =&gt; "blabla"}
  </code></pre>
  
  <p>So the array looks like this:</p>
  
  <pre><code>[{"url" =&gt; "http://www.example0.com", "description" =&gt; "blabla0"},
  {"url" =&gt; "http://www.example1.com", "description" =&gt; "blabla1"},
  {"url" =&gt; "http://www.example2.com", "description" =&gt; "blabla2"}]
  </code></pre>
  
  <p>I'm now making a form to create a new <code>onlinescore</code> and for that I need a way to collect input for that array. I'd like to have 2 fields ("url" and "description") who get mapped into the urls array somehow. Once that works, I would want the user to be able to add several urls at once, for example with an 'add new url' button which generates another 2 of those fields.</p>
  
  <p>I already tried to accomplish this on some ways for example like this:</p>
  
  <pre><code>#rest of form
  &lt;% @onlinescore.url.each do |link| %&gt;
    &lt;% form.inputs :for =&gt; link do |urls| %&gt;
      &lt;%= urls.input :url, :as =&gt; :url %&gt;
      &lt;%= urls.input :description, :as =&gt; :string %&gt;
    &lt;% end %&gt;
  &lt;% end %&gt;
  #rest of form
  </code></pre>
  
  <p>which gives the error:</p>
  
  <blockquote>
    <p>undefined method `model_name' for Hash:Class</p>
  </blockquote>
  
  <p>I also tried to define a new input type :score_url but I didn't get far with that either because I need a tuple of 2 fields, not one and I didn't find a way to do that yet. I looked into forms without a model, but I don't really think that is what I need either...</p>
  
  <p>Does anyone have an idea how to do this? </p>