https://avo.cool logo
Hello! Why when I get this: The suggestions don...
# avo-2
m
Thread automatically created by sillygirrrl in #740893011994738751
f
Or even if I try to get as suggestions results from an association:
Copy code
field :pets, as: :tags, suggestions: -> {
 record.pets.cats.map do |pet|
   pet.id
 end
}
l
Hei there, what version are you using?
f
it's
gem 'avo', '2.41.0'
l
I'll have a look, is there any JS error in the console when clicking on the input?
f
I tried to put an array
Copy code
field :pets, as: :tags, suggestions: -> {
['Example 1', 'Example 2']
}
And this works correctly
l
What is the output of this?
Copy code
ruby
 record.pets.cats.map do |pet|
   pet.id
 end
f
should be the ids of the cats associated to the current record
l
Can you check if it output what's expected when get the chance please?
If it works fine with the hardcoded array maybe the
record.pets.cats...
code is returning something unexpected
l
hmm, can you try
pet.id.to_s
?
f
Oh sorry, that works!
Thank you!
l
Anytime!
No need to apologize, happy coding