Lot's of Ember Learning

After poking through the source code for Ember Data and Ember to try and determine why there wasn't any data being sent in the HTTP POST, I've finally had a break through.

The break through came not from digging through the source, which was a lot of fun, but from finally finding relavant Google search. I turned up this question on StackOverflow. To find the post I searched Goolge with "ember data type._create". So I guess working with the source did help because that's where I found the call to type._create.

The answer to the question is to install the latest Beta version of Ember Data. I was using version .14 originally after following the suggested bower install ember-data --save. After cloning the repo and following the setup instructions I was able to build the packages and copy a new ember-data.js file into my project.

There were a few new errors in the Chrome Dev Tools console, but a few adjustments to my app.js file were all that was needed to update to the new Ember Data syntax. So back to my code that uses the createRecord method and still not seeing anything in the output from my Flask server where I called print request.form to view the POST data. Since there weren't any additional errors in the JavaScript console, I got to thinking that maybe there was some data and I'm just not seeing it. The print request.form call has worked with a non-Ember Data version, so I thought it would work here as well.

Silly me. I then googled "flask post content" and turned up this StackOver flow post. And you guessed it after calling print request.data I was able to see a "dvd" JSON string sent to the server via HTTP POST.

A quick look at the database and voila new records in the table. Actually there were a lot of new records in the table. Most of them had empty strings because I wasn't passing the correct data into the SQL query.

Lessons Learned:

  1. Build from the latest source if a project is in heavy development. (this did occur to several days ago, but I didn't listent to myself)
  2. Double check the database.
  3. Print the entire request object on the server side.

Top 2 Tech Ideas:

  1. Add Giflinks to a web app for added fun.
  2. Might use Smart Fixed Navigation for a web app project. Might be good for Photolandia instead of Headroom.js.

Party On!