https://avo.cool logo
Resource sidebar
# general
c
Hello! I'm evaluating Avo for a new project at work. There's a lot to like but there's one thing I can't find in the docs. Is there a way to render multiple text field inputs on the same line? I am working with a table with many columns and it would take up way too much vertical space to render one line per column. Thanks!
l
Hello @clever-motherboard-43747 I think the resource sidebar would save you some vertical space, take a look https://docs.avohq.io/2.0/resource-sidebar.html#adding-fields-to-the-sidebar
You always can do a custom field or custom resource tool if want something more costumized
BTW we hope you're enjoying the evaluation experience, any question you can reach us on this channel or on github issues if it's something more technical
c
Is there a way to provide your own template for a resource? Like overriding show.html.erb in active admin.
For more context, I'm dealing with a table that has multiple sets of address fields (street, unit, city, state, zip). I need to show a small input for a two-letter state abbreviation and not a full-width input
l
hey @clever-motherboard-43747 👋
in theory you can override everything in Avo
you could try to override the
Avo::Views::ResourceIndexComponent
but that's not the way to go IMHO https://github.com/avo-hq/avo/blob/main/app/components/avo/views/resource_index_component.html.erb
what I do see useful is to have a new feature where one could pass in a
stack
block and pass the fields inside that
Copy code
ruby
stack do
  field :state, as: :text, width: "25%"
  field :town, as: :text, width: :one_quarter
  field :street_address, as: :text, width: :one_half
end
something like that
we would merge a PR for that if we had one
c
"stack" feels like a column to me, and I'm looking for a row - or more direct control over the layout in general
l
got it! yeah, maybe
row
would be a better alternative
hmmm, I mean, you should play around with it and try it for yourself
it will be finniky
I would try to attempt to implement the
row
feature I would start from the
has_fields.rb
fiel to add the
row
method, then add a builder for it and then go for the
item_switcher_component.rb
to display the row
unfortunately we're a bit busy with last touches on Avo 3, otherwise we would jump on it
c
Thanks for the advice Adrian! I was able to implement a simple row pretty quickly. I'm running into issues with styling and layout that someone from the Avo team could probably resolve much faster than I can - I'll open a draft PR so you can take a look
l
hey man! thanks a lot for starting this
let me have a look
I appreciate the help and championing this
2 Views