avo-hq / avo

Build Ruby on Rails apps 10x faster
https://avohq.io
Other
1.51k stars 242 forks source link

System-wide dynamic search fields #2711

Open adrianthedev opened 6 months ago

adrianthedev commented 6 months ago

Feature

We need a better story around searchable, and dynamic "multi-select" fields.

### Places we need to think about this
- [ ] Basic select filters
- [ ] Dynamic filters - belongs_to filter (hw_comb)
- [ ] Dynamic filters - select filter (hw_comb)
- [ ] Dynamic filters - select & belongs to taggable (multiple options selected)
- [ ] (multi)select field (w ecould use tagify)
- [ ] `belongs_to` field
- [ ] `has_many` attach

Possible solutions

Related issues

Current workarounds

Using the tags field or a custom one.

github-actions[bot] commented 5 months ago

This issue has been marked as stale because there was no activity for the past 15 days.

github-actions[bot] commented 4 months ago

This issue has been marked as stale because there was no activity for the past 15 days.

rctneil commented 3 months ago

@adrianthedev Thanks for merging my suggestion with this one.

I did have a go at using the tags field last night instead of text, but was getting an error and i think it was to do with it having trouble joining the value from the database with the array of suggestions from my model method.

Not got any code on me right now but i'll look this evening and post a complete issue if needed, but if you have any suggestions for how to use the tags field instead of text to allow a suggestion list that would be incredible!

adrianthedev commented 3 months ago

I don't have a tutorial but that's achievable using mode: :select and fetch_values_from.

rctneil commented 3 months ago

Ah, I don't think i can use that as it looks to save the value as an id. I need to keep the text field as a text field storing it as a text value, but with an auto-complete or auto suggestion of other values in the same field on other records.

Paul-Bob commented 3 months ago

update_using helps in this scenario, you can format the input before it's saved.