Order in `only` param matters #25

Closed
adrianheine opened this Issue Jun 19, 2013 · 2 comments

Comments

Projects
None yet
2 participants

If I call resources with {only: ['index', 'show', 'new', 'create']}, /resource/new is interpreted as a show request for id new.

Contributor

olalonde commented Jun 20, 2013

This only happens when you use only?

Looking at the code this seems to be the case, yes. The other options depend on the order the keys of availableRoutes are iterated. This order is not guaranteed to be what you might expect, but it works in most if not all JS environments I know. Since order matters so much I would suggest to use an array, though.

1602 closed this in 2d10b8c Jul 10, 2013

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