You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's confusion in Avo regarding resource generation.
Scenario:
We use the pay gem and want to show the subscriptions inside Avo.
We start by generating a resource r g avo:resource subscription. Next, we have to change the model_class to Pay::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 be subscriptions. SubscriptionResource turns to subscription not pay_subscriptions. Next we'll notice that the generated controller for that resource SubscriptionsController does not work. We have to manually change it to PaySubscriptionsController for 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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There's confusion in Avo regarding resource generation.
Scenario:
We use the
pay
gem 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_class
toPay::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
.SubscriptionResource
turns tosubscription
notpay_subscriptions
. Next we'll notice that the generated controller for that resourceSubscriptionsController
does not work. We have to manually change it toPaySubscriptionsController
for 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