hey everyone - I was wondering if its possible ...
# avo-2
f
hey everyone - I was wondering if its possible to have a resource that's not backed by an active record model? I have a simple key/val hash that I'd like to treat as a resource, at least for just the index page? and to be able to sort the index page by key or value? Is this possible?
m
Thread automatically created by gee_forr in #740893011994738751
l
Hello there, you can achieve that behavior using [tools](https://docs.avohq.io/2.0/custom-tools.html#generate-tools) or [resource tools](https://docs.avohq.io/2.0/resource-tools.html#resource-tools)
f
hey there - thanks for the response. I'll take a look.
l
Resource tools are usefull when you want to implement some custom page and render it inside some resource's show page
Tools are ussefull when you want an custom independent page
l
I don't know if that's possible TBH
it's something that we'd like to support at some point. we have a PoC with that but not ready for releasing
maybe using something like that
or maybe there's some room for someone to make a gem
f
I'm trying to use
ActiveHash
right now https://github.com/active-hash/active_hash
its quite challenging as pagy is breaking everywhere
not really Avo's problem though. @lemon-wall-20836 or @loud-jewelry-99127 I wonder - is it possible to completely disable index pagination on a single resource?
l
brb. on a call right now
ok. so probably that needs to be investigated and make pagy work with active_hash
if there are methods that pagy needs and are missing from active_hash, you can add them personally to your model to bridge the gap
f
hi @lemon-wall-20836 - yeah - I'm busy monkey patching active hash to support the missing or different methods, i was just wondering if it's possible to deactivate pagination completely for a single resource to work around the problem.
l
there is not a way to do that, but if you'd like to add a PR to extract the pagination bit in a method that is overridable, we would merge it
f
I'll take a look - honestly, activehash is not work the hassle - to get it working, but I'll still look at the pagination - time permitting
l
Hei @future-match-90639 Could you provide more context?
l
just set it then 😛
f
I am using active hash and want to: - display associated categories in avo (offer has_many categories) -> does not work - add has_one_attached :image to an active_hash model -> more trouble anyway ActiveHash has been a pain (have to do a lot of inclusions and patches all around), so moving away from it. nothing for you to do 🙂
l
we didn't know about active hash when we built the array adapter
it's a pitty it's not working nicely