agreeable-jelly-60158
06/06/2024, 5:07 PMpurple-park-97233
06/22/2024, 11:33 AMproud-breakfast-80041
07/04/2024, 11:48 AMproud-breakfast-80041
07/04/2024, 2:40 PMproud-breakfast-80041
07/09/2024, 9:18 AMvia_relation=events
when i click save player is saved, however there is an error in redirection in this method
def after_create_path
# If this is an associated record return to the association show page
if is_associated_record?
parent_resource = if params[:via_resource_class].present?
Avo.resource_manager.get_resource(params[:via_resource_class])
else
Avo.resource_manager.get_resource_by_model_class(params[:via_relation_class])
end
association_name = BaseResource.valid_association_name(@record, params[:via_relation])
return resource_view_path(
record: @record.send(association_name),
resource: parent_resource,
resource_id: params[:via_record_id]
)
end
as association_name returns nil , because` params[:via_relation]`
is events but the association to the player is actually eventnarrow-laptop-54609
07/11/2024, 8:21 PMfuture-garden-51299
07/18/2024, 6:02 PMmammoth-guitar-49791
07/27/2024, 11:38 AMpurple-park-97233
08/01/2024, 7:12 PMfriendly_id and have set the index query to:
self.find_record_method = -> {
if id.is_a?(Array)
query.where(slug: id)
else
query.friendly.find id
end
}
This too works great. Each record has it's slug and in my app, the slug of an Attraction contains the name and another attribute of the Venue it is associated with. I have it all configured so that if the name or location_1 values of the Venue get changed, then the slugs of the Attractions get updated too. I know slugs don't typically change but it is very useful in my case.
If I make a change to a Venue that causes a new slug to be generated and I came from a standard Resource Index view (eg: http://localhost:3000/avo/resources/venues/drayton-manor-drayton-bassett) and edit it, it's fine, but if I get to the edit page and I have a URL like (http://localhost:3000/avo/resources/venues/drayton-manor-drayton-bassett?via_record_id=accelerator-drayton-manor-drayton-bassett&via_resource_class=Avo%3A%3AResources%3A%3AAttraction)
When it tries to go back to the page in the via_record_id query param, it fails, because the slug is no different and the record can't be found.
It all makes sense and I understand why it's occuring.
My question is, what do you think? Are there any options to overcome this? Can you think of other ways to deal with this?
I am considering adding a new field altogether which sort of replicates the nromal slug field but always stays in sync with the name, venue and location_1 values and just let the regular slug column act like that and once set, never change. Would that make more sense?purple-park-97233
08/05/2024, 5:32 PMboundless-printer-62821
08/09/2024, 3:36 PMdefault_sort_column , but is it also possible to change the default sort order to asc (it defaults to descending otherwise)?narrow-electrician-89982
09/11/2024, 6:59 PMrecord_selector = false should be set by default instead of true, since there's no need to show the select field unless you have an action that does something to the selected records; which in 99% of the cases, no one hasbillowy-airline-65932
09/20/2024, 6:00 PMfield that you need to display on the Index view? For example: I have a field as badge, but my filter for this field needs to be as :select. Any ideas on how I could have this config?billowy-airline-65932
10/03/2024, 7:04 PMstraight-pager-31449
10/12/2024, 5:23 AMclass Avo::Cards::SumTotalNumber < Avo::Cards::PartialCard
self.partial = 'avo/cards/sum_total_number'
def query
self.id = arguments[:id]
...
end
end
def cards
card Avo::Cards::SumTotalNumber, cols: 1, rows: 2,
arguments: { id: :foobar, foo_data:, bar_statistics:...
...helpful-waitress-4127
02/12/2025, 6:41 PMminiature-optician-85831
03/23/2025, 1:29 PMpurple-park-97233
03/23/2025, 1:37 PMhas_many :companyables, as: :companyable
has_many :companies, -> { distinct }, through: :companyables
Company:
has_many :companyables
has_many :attractions, through: :companyables, source: :companyable, source_type: 'Attraction'
has_many :roles, -> { distinct }, through: :companyables
Companyable:
belongs_to :company
belongs_to :companyable, polymorphic: true
belongs_to :role, optional: true
belongs_to :model, optional: true
belongs_to :submodel, optional: true
This works fine and on my Attraction resource I have:
tab "Companies" do
field :companyables, as: :has_many
end
This works fine and allows me to add new companyables via the UI where I can select the Role, the Model, and the SubModel for it. This all makes sense to me, but looking at it from a User perspective, they have no idea what a "Companyable" is, it's a made up word that means absolutely nothing to them.
To them they "want to add a Company to an Attraction", but technically what they need to do is "Add a Companyable to an Attraction" as the Companyable holds all the info about the role and the model/submodel.
Do I leave everything as it is and try to explain to Users what it means or can you recommend changes that may make it more user friendly and user understandable?
Changes could be as simple as altering wording. Could I change "Companyable" to "Company" just in the context of the UI? If I did that then the sidebar item for "Companyables" would be confusing.
It's tricky. Technically it all works beautifully and i'm very happy with it. Right now I ahve no plans to roll this out to other people so it is a non issue but it is something i've been thinking of how I could overcome it if I was to roll it out to others in the future.miniature-optician-85831
03/23/2025, 1:37 PMpurple-park-97233
10/09/2025, 9:30 AMNoMethodError in Avo::Venues#index
Showing /home/vscode/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/avo-3.25.0/app/views/avo/base/index.html.erb where line #2 raised:
undefined method 'avo_pro' for an instance of #<Class:0x0000ffff7206cee0>
All I added was the following in order to enable record reordering:
self.ordering = {
visible_on: :index,
actions: {
higher: -> { record.move_higher },
lower: -> { record.move_lower },
to_top: -> { record.move_to_top },
to_bottom: -> { record.move_to_bottom },
}
}miniature-optician-85831
10/09/2025, 9:32 AMclever-pillow-79177
10/23/2025, 10:27 PMmagnificent-jackal-1244
10/28/2025, 10:26 AMnice-ambulance-76519
11/06/2025, 2:41 PMable-engine-47078
04/29/2026, 5:42 PMmain_panel do
field ...
field ...
field ...
end
panel do
card ...
card ...
card ...
end
So I can position cards in specific places rather than be limited to the cards across the top of a page?able-engine-47078
04/29/2026, 6:20 PMpurple-park-97233
06/02/2026, 5:11 PMsearchable: true, when I click to choose Photos, the resulting UI, either a standard select box or the searchable custom UI, are neither very useful due to this being a more visual record type.
Ideally, we could have a UI similar to the media browser, but showing Photo records and using a specific field on the Photo record as the thing to display (eg, the file attachment).wide-waiter-22763
07/08/2026, 5:15 AMabsence.update, or just call some kind of "Service" all together, which handles the update and all side effects. However, with Avo, I'm not writing the controller myself - and as far as I can tell from the documentation, I can only set some redirect paths and similar in the controllers.
One way to solve this would be callbacks in my model, a before_update :update_absence_days. This works, however, I generally try to avoid callbacks, as they are hard to reason about, especially in large applications, and they make testing harder, especially when creating records with FactoryBot
Another way I found are actions, where I can mimic the editable fields and then do all of my logic inside the def handle method. That works well, and I can disable the regular edit with authorization. However, it is rather verbose to add an action for each of the modifying CRUD operations (to be fair, I currently only need these side effects for very few ressources, but that might change).
Are there any other ways to handle these kinds of side effects that I'm missing? Did you maybe think about this topic and came to something like a "suggested solution"? Thanks for any input! πwide-waiter-22763
07/16/2026, 10:53 AMrole, that works fine. Now I want to extend this to multi select:
1. With the Standard filters, I can manually select multiple entries by CMD+click. However, only ~4 entries are shown, but my list is a lot longer - the filter is missing a scrollbar! And besides that, the UX could be improved to something like the tags-field (I know, multi selects are really hard, been there, done that...)
2. I tried out dynamic filters, but could only filter for one role, not for multiple. Any chances or plans to add this? Could be a good reason for upgrading my subscription πwide-waiter-22763
08/18/2026, 5:25 AMself.empty_message is shown when there are no options. But actually, it is simply used in the template as include_blank: filter.class.empty_message || "β". So it can be used to overwrite the default unselected value with e.g. "All" or to remove the empty option all together. Might be even easier to just call this self.include_blank π
The other one is also about the empty option. When e.g. browsing the [Avo demo posts resource](https://main.avodemo.com/avo/resources/posts), there is a basic select filter for the published state. Selecting published posts works, and then switching back to "β" shows all posts again. However, switching on persistence with config.persistence = { driver: :session } in the avo.rb breaks this behaviour. Now switching back to "β" will always switch back to the last chosen option (e.g. published). When adding a debugger to the def apply for this filter, it shows that the value only ever comes in as "published", but never as empty string, nil, or similar, so this happens before this method. I didn't look into the code here, but probably it just checks if an option is selected and if not, applies the last filter state from the persistent memory. So this probably needs some kind of check whether the empty option was picked on purpose or if it is the initial page visit for that resource...