-
Notifications
You must be signed in to change notification settings - Fork 108
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
Better support for shallow routes #203
Comments
@brendon How would you anticipate it working? |
Without diving too deep I think perhaps a shortcut key (like some of the others) such as |
I guess I don't understand what you mean by shallow routing then. DecentExposure doesn't correlate to routing at all. Are you just trying to shortcut a way to auto look at some parent_id? |
Shallow routing in Rails just means that at any one time there's only one DecentExposure does have some consideration of parent/child resources (e.g. via scopes and some of the other shortcut keys) but I think it makes the assumption that you'd always work your way down from the parent to the child when doing operations on the child (e.g. the Hope that helps explain it a bit more? |
Thanks for the additional context. I'm open to adding features when they make sense. Currently I'm still not understanding the need. If you want to give some examples of the interface you'd like to see and what you'd expect it to do, I'll take a look and try to further understand. |
No worries at all :) I'll have better crack at explaining: Given a routes setup like this:
We get the following routes:
In order to expose these relations, currently I need to do the following:
These are the reasons for the overrides:
It's not too much to override, but to do it every time gets a bit verbose and there's definitely a pattern there. In terms of an interface, perhaps something like:
Kinda messy naming. I'm sure with some extra thought I could come up with something. Let me know what you think. |
This is just a quick ping to test your appetite for modifications to
decent_exposure
so that it more smoothly supports shallow routes in Rails.I've been working around it for many years now with more convoluted exposures but it could be something that the gem supports natively. I'm not sure if you're still using the gem in your own work day to day and if you've come across this yourself?
Primary considerations for shallow routes:
parent_id
param. Theid
param will only ever be present for the child resource.That's all I can think of off the top of my head, but I just wanted to raise it again in case you're more open to it these days :D
This is an example of my more convoluted exposures:
The text was updated successfully, but these errors were encountered: