I have this structure and I was wondering if there...
# avo-2
i
I have this structure and I was wondering if there's any quick way to have 3 tables with the records grouped by the GROUP column, say, one table with the games for group A, one for B and one for C (I am aiming not to create a whole dashboard or something unless it's really necessary)
l
Hey 👋. What is the business need there?
Why do you want to show three tables?
i
it's an app for managing sports tournaments, having a table per group would be friendlier for admins, without having to filter by groups or anything
l
So they need to be able to see the same data but grouped together in different tables?
That’s rather custom behavior
You can achieve that using a custom tool and add three turbo-frames that have the src to the index view, but with filters applied
So a filter that has options a b and c
And each link would have that filter applied
And you’d need to set the turbo_frame get request
See how we do it on the has many show field
i
Got it, thanks Adrian, also, a quick question: can I set a default value to a :key_value field ? Lets say, a json with some keys so the field renders it as a placeholder so the admin only needs to fill in the values
l
Hmmm. Have you tried using the defualt option?
i
nope, since it's not in the docs 😛
let me try'
Do you mean this?
i
I was referring to the docs on the key_value field 😛
l
Oh, you gotta be curious man
Try out things
i
default: -> { { "Set 1" => "0-0", "Set 2" => "0-0", "Set 3" => "0-0", "Set 4" => "0-0", "Set 5" => "0-0" } }
that didn't make any difference
l
It might be that it’s not implemented in key value
I don’t see the default value here
Are you up for a PR 😁?
i
not right now, but I can probably take a look at it later
l
Cool! Thank you!
Let me know if I can help you navigate the codebase
7 Views