sirupsen / airrecord

Ruby wrapper for Airtable, your personal database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Airrecord api does not allow string interpolation.

drubio1989 opened this issue · comments

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.

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.