title: Grid forms in Rails
body: <p>I am trying to create a grid form for a survey question.</p>
  
  <pre><code>            value1     value2   value3
  
  option 1      x
  
  option 2                 x
  
  option 3      x
  </code></pre>
  
  <p>Each cell in the grid is a radio button and the radio buttons in a row belong to one radio button group.</p>
  
  <p>My models:</p>
  
  <pre><code>class Question
    # title
    has_many :answers
  end
  
  class Answer
    # name, position, atype(row/col)  
  end
  </code></pre>
  
  <p>Sample data for questions:</p>
  
  <pre><code>id  title
  --  ------
  1   Rate the following movies
  </code></pre>
  
  <p>Sample data for answers:</p>
  
  <pre><code>id  question_id  atype   position   name
  --  -----------  -----   --------   --------
  1   1            row     1          God Father
  2   1            row     2          Star Wars
  3   1            row     3          Aliens
  
  4   1            col     1          Bad
  5   1            col     2          Average
  6   1            col     3          Good
  </code></pre>
  
  <p>I am struggling to come up with a Rails approach for creating such a form. To complicate the issue user can save the semi-completed form and complete it at a later time.</p>
  
  <p>What is the best approach for this problem?</p>