title: ExtJs4 json data.store and Rails
body: <p>I'm trying to create a simple CRUD application using ExtJs4 and Ruby On Rails. I'm trying to implement resftul datata store with JSON.</p>
  
  <p>I have problem with updating a record. The request is being sent to the server side and database is being updated but in the data store I still have record marked as "dirty". And when I'm trying to update an another record I have two request sent (one for previous record and another for the next record).</p>
  
  <p>Also I have problems with creating a new record. A record is being created on the server side, but in my data store it's still marked as unsaved (dirty) so during next update / create action that record sent to the server once again and in the outcome I have duplicated records in my db.</p>
  
  <p>The question is - how to build a valid data store and corresponding model to work with restful json from Rails?</p>
  
  <p>Sources of my application you can find on my github account: <a href="https://github.com/lucassus/extjs4-account-manager" rel="nofollow">https://github.com/lucassus/extjs4-account-manager</a></p>
  
  <p>the store: <a href="https://github.com/lucassus/extjs4-account-manager/blob/master/public/javascripts/app/store/Users.js" rel="nofollow">https://github.com/lucassus/extjs4-account-manager/blob/master/public/javascripts/app/store/Users.js</a>
  and the model: <a href="https://github.com/lucassus/extjs4-account-manager/blob/master/public/javascripts/app/model/User.js" rel="nofollow">https://github.com/lucassus/extjs4-account-manager/blob/master/public/javascripts/app/model/User.js</a></p>