function(model, params) {
    if (params.length < 1) { return; }
    if (!model) { return; }

    var name = params[0], object = {};

    if (/_id$/.test(name) && params.length === 1) {
      object[name] = get(model, "id");
    } else {
      object = getProperties(model, params);
    }

    return object;
  }
function(model, params) {
    if (params.length < 1) { return; }
    if (!model) { return; }

    var name = params[0], object = {};

    if (/_id$/.test(name) && params.length === 1) {
      object[name] = get(model, "id");
    } else {
      object = getProperties(model, params);
    }

    return object;
  }
function ( model , params ) { if ( params . length < 1 ) { return ; } if ( ! model ) { return ; } var name = params [ 0 ] , object = { } ; if ( / _id$ / . test ( name ) && params . length === 1 ) { object [ name ] = get ( model , "id" ) ; } else { object = getProperties ( model , params ) ; } return object ; }
A hook you can implement to convert the route's model into parameters
for the URL.

```js
App.Router.map(function() {
this.resource('post', {path: '/posts/:post_id'});
});

App.PostRoute = Ember.Route.extend({
model: function(params) {
the server returns `{ id: 12 }`
return jQuery.getJSON("/posts/" + params.post_id);
},

serialize: function(model) {
this will make the URL `/posts/12`
return { post_id: model.id };
}
});
```

The default `serialize` method will insert the model's `id` into the
route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.
If the route has multiple dynamic segments or does not contain '_id', `serialize`
will return `Ember.getProperties(model, params)`

This method is called when `transitionTo` is called with a context
in order to populate the URL.

@method serialize
@param {Object} model the route's model
@param {Array} params an Array of parameter names for the current
route (in the example, `['post_id']`.
@return {Object} the serialized parameters
A hook you can implement to convert the route s model into parameters for the URL .