Address the models/resources -> routes debacle #846
adrianthedev
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There's confusion in Avo regarding resource generation.
Scenario:
We use the
paygem and want to show the subscriptions inside Avo.We start by generating a resource
r g avo:resource subscription. Next, we have to change themodel_classtoPay::Subscription. Now we notice that the path generated for that resource is/avo/resources/pay_subscriptions.Notice the
pay_subscriptions. We might expect it to besubscriptions.SubscriptionResourceturns tosubscriptionnotpay_subscriptions. Next we'll notice that the generated controller for that resourceSubscriptionsControllerdoes not work. We have to manually change it toPaySubscriptionsControllerfor it to work.That's because we went from the assumption that the routes should be generated based on the model, and not the resource.
Cons
That's bad (as @yrashk mentioned) because if we'd like to use multiple resources for the same model, that wouldn't really work out of the box.
We're open to suggestions on if we should or shouldn't move the routing from the model to the resource.
Beta Was this translation helpful? Give feedback.
All reactions