Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

similarly named nested resources not provided for #37

Open
jupiter opened this issue Sep 15, 2011 · 5 comments
Open

similarly named nested resources not provided for #37

jupiter opened this issue Sep 15, 2011 · 5 comments

Comments

@jupiter
Copy link

jupiter commented Sep 15, 2011

This works:

    var photos = app.resource('photos', photosController)
      , posts = app.resource('posts', postsController)
      , photosComments = app.resource('comments', commentsController)
      , postsComments = app.resource('comments', commentsController);

    photos.add(photosComments);
    posts.add(postsComments);

However, I am not sure whether this will create problems down the line. Particularly because app.resources.comments will always be the last nested resource added, and the first one would not be accessible via app.resources.

@dmmalam
Copy link

dmmalam commented Nov 8, 2011

Same issue here

@piotrek-r
Copy link

+1, just got to this point in my app

@suprememoocow
Copy link

I have two nested resources with the same name, but different controllers, and have been experiencing issue. I'm using the Resource class directly as a work-around for now, and it seems to work well....

 var photos = app.resource('photos', photosController)
      , posts = app.resource('posts', postsController)
      , photosComments = new Resource('comments', photoCommentsController, app)
      , postsComments = new Resource('comments', postCommentsController, app);

photos.add(photosComments);
posts.add(postsComments);

@vjpr
Copy link

vjpr commented Jun 7, 2013

+1

@vjpr
Copy link

vjpr commented Jun 7, 2013

Using the workaround when re-using a root level resource results in the load method for collections/links being run for /links.

/links
/collections/:id/links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants