title: TypeError: Cannot read property 'replace' of undefined vue-resource.js:284
body: <p>Can anyone please help me with this error?</p>
  
  <p>I have been using jQuery along with vue.js. Below is the method I am having issue with... It is called by a post request. <code>new_user</code> contains values received from the html form fields...</p>
  
  <p>Values are being received nicely when I write it in console. </p>
  
  <p>Problem comes when I try to use ajax method to store the data (this.$http.post()). I get the following error:</p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'replace' of undefined
    vue-resource.js:284</p>
  </blockquote>
  
  <p>There were couple of links I went through.but i could take help from none... I might have made some silly mistakes because I used the above code from a perfectly running script. So if anyone can spot the mistake i would be grateful. Thanks... :)</p>
  
  <p>Happy coding.</p>
  
  <pre><code>    addUser : function(new_user){
          // var instance = this;
          console.log(this)
          var new_user_input = this.new_user
          console.log(new_user_input.name)//this works fine..
  
           //problem comes right here
           this.$http.post("clients/" , new_user_input).then((response) =&gt; {
              alert("ok")
          },(response) =&gt; {
              alert("failed")
              this.form_errors = response.data
              // console.log("here should be the form errrors " + response.data.title)
          });
      }
  </code></pre>