anchor.diff:      <div class="control-group">
         <%= f.label :poll_type, :class => "control-label"%>
         <div class="controls">
  -        <%= f.select(:poll_type, options_for_select([['Open','OPEN'],['Multiple Choice','MULTI']], @poll.poll_type)) %> <!-- broken! -->
  -      </div>
  -    </div>
  -  </fieldset>
  -
  -  <fieldset class="multichoice" style="display:none">
  -    <div class="control-group">
  -      <%= f.label :choices, :class=> "control-label"%>
  -      <input id="add-choice" class="btn add-choice" value="+" type="button" style="position:relative; top: 2em; right: 2em;"></input>
  -      <div class="field" id="choices-container">
  -        <div class="controls">
  -          <%= f.text_area :choices, :style=>'display:none' %>
  -          <div id="choices" class="choices">
  -
  -          </div>
  -        </div>
  +        <%= f.select(:poll_type, options_for_select([['Open','OPEN'],['Multiple Choice','MULTI']],1)) %>
         </div>
       </div>
     </fieldset>
  
positive.code: <script type="text/javascript">
  $(function(){
    var alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l'];
    var choiceInputs = [];
    var choicesDiv = $('#choices');
    var choicesJSONInput = $('#poll_choices');
    var boundInputs = [];
  
    scan_for_multi();
    
    $('#poll_poll_type').bind('change', scan_for_multi);
  
    $('.add-choice').click(function(){
      build_multi_input(alphabet[choiceInputs.length]);
    });
  
    function scan_for_multi(){
      if ($('#poll_poll_type').val() == 'MULTI'){
        build_multi_inputs();
        $('.multichoice').show()
      } else {
        $('.multichoice').hide()
        // hide multiple choice inputs
      }
    }
  
    function build_multi_inputs(){
      var choices = {};
      var choicesPayload = choicesJSONInput.val();
      choiceInputs = [];
      choicesDiv.empty();
      if (choicesPayload){
        choices = JSON.parse(choicesJSONInput.val())
        $.each(choices, function(key, value){
          build_multi_input(key, value);
        });
      } else {
        build_multi_input(alphabet[0]);
      }
      
    }
  
    function build_multi_input(key, value){
      console.log("creating input for "+key+" "+value);
      var choiceDiv = $(document.createElement('div'));
      choiceDiv.class = "choice";
      choiceDiv.text(key + ". ");
      var choiceInput = $(document.createElement('textarea'));
      choiceInput.class = "choice-input";
      choiceInput.val(value);
      choiceDiv.append(choiceInput);
      choiceInputs.push(choiceInput);
      choicesDiv.append(choiceDiv);
      choiceInput.bind('change',on_multi_input_change);
    }
  
    function push_choices(){
      var choicesObj = {};
      $.each(choiceInputs, function(index,item){
        choicesObj[alphabet[index]] = item.val();
      });
      choicesJSONInput.val(JSON.stringify(choicesObj));
    }
  
    function on_multi_input_change(){
      console.log('input changed');
      push_choices();
    }
  });
  
  </script>
  
  <%= form_for(@poll, :html => { :class => "form-horizontal"}) do |f| %>
    <% if @poll.errors.any? %>
      <div id="error_explanation">
  
negative.code:       <%= f.label :title, :class => "control-label"%>
        <div class="controls">
          <%= f.text_field :title %> <span class="help-inline">This is how we'll refer to the poll in text messages and reports</span>
          div>
      </div>
    </fieldset>
  
  