title: Storing an array of hashes in Rails
body: <p>I'm working on an app in rails and I want to store an ordered array of hashes in ActiveRecord, but it'm running into a snag(s). I want to store a URL, the hash's position in the array, and a few metrics associated with a single keyword.</p>
  
  <p>I've tried to use a has_many/belongs_to association between a keyword/rankings model, and I tried storing the array of hashes in a single cell with serialize, but it's not writing to the db for some reason.</p>
  
  <p>Here's what I want to store:</p>
  
  <pre><code>Keyword - [{rank(1), url, metric1, metric2}, {rank(2), url, metric1, metric2},...{rank(n), url, metric1, metric2}]
  </code></pre>
  
  <p>I guess I'm just struggling with the technical implementation; tried two different models with associations, serialize, and so on. Can anyone help?</p>