anchor.diff: +<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">
  
positive.code:     <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']],1)) %>
        </div>
      </div>
    </fieldset>
  
negative.code:       <%= f.label :phone, :class => "control-label"%>
        <div class="controls">
          <input class="input disabled" type="text" disabled="" placeholder="<%= number_to_phone(@poll.phone, :area_code => true) %>"> <span class="help-inline">Automatically assigned</span>
        </div>
      </div>
    </fieldset>
    
   
    <fieldset>
      <div class="control-group">
       <div class="field" style="display:none">
          <%= f.label :start_date %>
          <%= f.datetime_select :start_date, :default=>Time.now %>
        </div>
       <div class="field" style="">
          <%= f.label :end_date %>
          <%= f.date_select :end_date, :default=>Time.now + 1.month %>
        </div>
      </div>
    </fieldset>
  
  
    <div class="form-actions">
        <%= f.submit :class => 'btn btn-large btn-primary' %>
        <%= link_to 'Cancel', @poll, :class => 'btn btn-large' %>
    </div>
  <% end %>