I am trying to use grape-entity without the grape-api gem. So just use it as a serializers for raw rails controllers.
When trying to present my resource by doing:
present User.all, with: Entities::User
I get that the present method is undefined
How am I suppose to present those resources using the entity? The documentation says to use present
I needed to use Grape Entity as well, outside of Grape (in a basic Rails controller), and I ended up using Chris suggestion:
Entities::MyResource.represent MyResource.first
It works like a charm, thanks!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With