Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
[Rails] How best to name route associated with a join table that has no join model? #288
I'm experimenting with using
The join table that is created (using
Obtaining all of a user's favorites is possible through
I'm leaning toward making a
Is there a better/more semantic approach? Specific questions:
Not sure any of this will affect my functionality in any way, but I'm curious whether there's a best practice.
I understand you want you to try
There's a few reasons we don't teach
The best practice really is to avoid
If you want to stick strictly to convention, I'd have a
Better yet, if you want your path to dictate your architecture, you could go with a a namespaced
Finally, I'd argue that what you really have here is a relationship between users and patterns called favorites. So User
Well, almost all routes end in plural because we try to stick to RESTful, conventional, resourceful routes.
I almost want to say that "anything is better than a nested route" but for some reason I'm still fond of them. I think we're at the point where we can manage flat routes well. Especially since Ember is your client choice, flat routes seem a win here.
What isn't a win is mixing favorites and patterns. If I sent you a URL of
I hope I've convinced you this is a good move. And I think it will save a bit of headache. Thanks for giving me an excuse to wrestle with some really solid questions and I hope my answer has been helpful!
@jrhorn424 Convinced! And yeah, the noun/verb(/adjective) issue here is tricky. I blame social media (see: Facebook/Twitter "likes").