Airrecord api does not allow string interpolation.
drubio1989 opened this issue · comments
Daniel Rubio commented
I am trying to string interpolate for the filter value and cannot retrieve the desired record.
Example:
Tea.all(filter: '{China} = "#{somestring_value}"')
What is the correct way to string interpolate a value? I've tried many combinations and can't seem to get this to work.
Michael Holroyd commented
In ruby,
puts "Interpolation works in double quoted strings: #{1 + 2}."
puts 'And it does not work in single quoted strings: #{1 + 2}.'
You need
Tea.all(filter: "{China} = \"#{somestring_value}\"")
or maybe you can use single-quotes on the inside I forget.