title: Badly formed JSON when posting stringified Array (Javascript and Ruby)
body: <p>I have a pretty specific one here. I'm basically Trying to post an array of strings to one of my ruby servers and process it back to objects. Problem is when I send across the Json it comes out like this</p>
  
  <p>Its pretty bizarre syntax that's coming back to the server.</p>
  
  <p>So my question is where does my error lie and how do i fix it?</p>
  
  <p><strong>1:</strong>Is it my ruby/rails server not parsing json back correctly? (I doubt it as the json looks mangled anyway)</p>
  
  <p><strong>2:</strong> Is it the way I've constructed my array?</p>
  
  <p><strong>3:</strong>Or is it (most likely) How I'm posting my array?</p>
  
  <hr>
  
  <p>So just to give a little more detail.
  On the client side in the javascript I have your everyday array of strings.
  When I run this:</p>
  
  <p><strong>JAVASCRIPT ARRAY:</strong></p>
  
  <pre><code> var $arrayToSend = JSON.stringify(headersTitleArr);
   console.log($arrayToSend);
  </code></pre>
  
  <p>It produces:</p>
  
  <pre><code>[" Page Title "," Description "," Keywords "," Internal Links "," 
  External Links "," Content files "," Notes "]
  </code></pre>
  
  <p>After my post method which is listed as such:</p>
  
  <p><strong>JAVASCRIPT POST:</strong></p>
  
  <pre><code>$.ajax({
  
          type: 'POST',
          url: webAppURL+websiteID+".json",
          data:  {elementTypes:$arrayToSend},
          success:  function(){
              console.log("YIPPEE I HAS A SUCCESS");},
          dataType: 'json'
      });
  </code></pre>
  
  <p>On the ruby side, this is what comes up after dumping params as such:</p>
  
  <p>Ruby code as requested.</p>
  
  <p><strong>RUBY:</strong></p>
  
  <pre><code>puts YAML::dump(params[:elementTypes])
  @x = (params[:elementTypes])
  @elementTypes = JSON.parse(@x)
  </code></pre>
  
  <p>and the printed result on server:</p>
  
  <pre><code>--- "[\" Page Title      \",\" Description     \",\" Keywords        \",\" Internal 
  Links  \",\" External Links  \",\" Content files   \",\" Notes           \"]"
  </code></pre>