Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Modified the way to add singleton resources. #8
See README.md. I think it's much cleaner now. Mapping the singleton resource to a controller shouldn't be railway-routes' job since it's not expected as you mentioned. Let me know if you like this version better. I hope I didn't forget to follow the conventions too many times :/
Hey I fixed the README and added another commit to implement something I needed. Let me explain what I'm trying to achieve first. In my app, there are 3 ways to access a user's profile.
/account (user profile of currently logged user)
All those routes should have the same nested resources (subroutes) as they all basically represent the same resource. Here's how I implemented it:
ps: thinking about it now, I should actually replace
Anyways, the problem was that the nested routes path always begun with /users/. So I think I fixed this in this commit by prefixing subroutes by params.path if it is available, otherwise default to resource name like before.
It would also be nice if I could do something like below and I may work on implement it if you like the idea.
Let me know what you think about this.