https://avo.cool logo
Hello, by reading about cards, I wasn't able to...
# avo-3
a
Hello, by reading about cards, I wasn't able to read that information. The question is: whether it is possible by running in the loop, to have same card multiple times in the same dashboard? Something like:
Copy code
def cards
  locations.each do |location|
    card Avo::Cards::Sales::Timeline, some_param_here: location.id
  end
end
We're already using a card with multiple locations inside that one timeline chart, but was curious if possible to do separate timelines per location. Location Timeline 1 Location Timeline 2 Location Timeline 3
m
Thread automatically created by Giedrius in #1138182212655788054
l
Hi @aloof-zebra-84085 I'm not sure if it works out of the box, had you tried it?
a
It was complaining about keywords I am passing
unknown keywords: :location_id
my try:
Copy code
def cards
    Location.active_and_draft.each do |location|
      card Avo::Cards::QueueSpotsTimelineChart, location_id: location.id
    end
  end
The reason we want to have separate cards because there are many locations and one timeline with many locations is hardly visible already.
You can use
arguments
for this use case
Copy code
ruby
def cards
  Location.active_and_draft.each do |location|
    card Avo::Cards::QueueSpotsTimelineChart, arguments: { location_id: location.id }
  end
end
a
awesome. It worked, thank you very much!
l
Cool, anytime!
5 Views