Allow namespace'd id params to be overridden. #60

Closed
jaredhanson opened this Issue Nov 13, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Owner

jaredhanson commented Nov 13, 2012

For example, these routes:

this.match('devices/:deviceLibraryIdentifier/registrations/:passTypeIdentifier', 'registrations#index');
this.match('devices/:deviceLibraryIdentifier/registrations/:passTypeIdentifier/:serialNumber', 'registrations#create', { via: 'post'});
this.match('devices/:deviceLibraryIdentifier/registrations/:passTypeIdentifier/:serialNumber', 'registrations#destroy', { via: 'delete'});

could be declared using namespaces, except namespaces would use params:

device_id
pass_id
id
Owner

jaredhanson commented Nov 13, 2012

For example:

this.resources('devices', { param: 'deviceLibraryIdentifier' }, function() {
  this.resources('registrations', { param: 'passTypeIdentifier' }, function() {
    this.resource('serialNumber', { param: 'serialNumber' });
  });
});

Use of param could declare what param to use for the ID parameter. (exact name of option subject to change)

Contributor

drudge commented Nov 13, 2012

+1

Owner

jaredhanson commented Dec 7, 2013

This is addressed by the following commits to actionrouter: eb8bebc448 and f3f46b72d0

Will be available in the Locomotive 0.4.0 release, happening soon.

jaredhanson closed this Dec 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment