Ember-data embedded records current state?

Using the ActiveModelSerializer you can include the EmbeddedRecordsMixin which allows you to use embedded records. (In the canary versions, 1.0 beta 9+, you can use the JsonSerializer/RESTSerializer as well) Serializer App.ColorSerializer = DS.ActiveModelSerializer.extend(DS.EmbeddedRecordsMixin, { attrs: { foos: {embedded: ‘always’} } }); Models App.Color = DS.Model.extend({ color: DS.attr(), foos: DS.hasMany(‘foo’) }); App.Foo = DS.Model.extend({ name: DS.attr() … Read more

CRUD blueprint overriding in sails.js

Update In order to override blueprints in Sails 1.0 in the manner described below, you must first install the “custom blueprints” plugin for your project (npm install sails-hook-custom-blueprints). To override blueprints in Sails v0.10, you create an api/blueprints folder and add your blueprint files (e.g. find.js, create.js, etc.) within. You can take a look at … Read more

SPA best practices for authentication and session management

This question has been addressed, in a slightly different form, at length, here: RESTful Authentication But this addresses it from the server-side. Let’s look at this from the client-side. Before we do that, though, there’s an important prelude: Javascript Crypto is Hopeless Matasano’s article on this is famous, but the lessons contained therein are pretty … Read more