title: Complex hash editing with MVC/Padrino ruby 1.8.x
body: <p>I'm new to MVC. I'm using Padrino with MongoMapper and Haml to try to create this application.</p>
  
  <p>I have a database of items, each of which has a hash associated with it called 'params'. This hash has some required keys, but mostly arbitrary/random keys. Some of the keys have a finite set of allowable values.</p>
  
  <p>For example:</p>
  
  <p>item.params["password"] does NOT have a finite set of possible values.</p>
  
  <p>item.params["color"] must be one of %w{red blue green}</p>
  
  <p>What's the best way to create an editor for the items in this hash? I'd want a text-field for free-form values and menus for finite values. I'd also like these menus to have "Create New" as the bottom choice, so I can't just hard-code all of the finite-value sets.</p>
  
  <p>The best thing I can come up with for this is to have a new collection(table) in the DB that's just a Hash of default values. If your key isn't in this hash, you get a text-box.</p>
  
  <p>Seems like there has to be a better way though.</p>