Airtable ruby gem and tablenames with spaces

Topic Labels: API
1482 0
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

Hi I’m trying to use the airtable ruby gem and have run into a problem. If the table name contains spaces I cannot retrieve or add records. If I use a table name without spaces it works. I tried replacing the space with %20 but it didn’t help.

require 'airtable’
require ‘active_support/all’

client =“API_KEY”)
table = client.table(“APP_ID”, “‘Test Table’”)
records = table.records
print “#{records.count} records found\n"
record =“Creation Date” =>, “Name” => “P-Town Giants”, “Email” => "”, “Type” => “Team”)
res = table.create(record)
print res unless res

UPDATE: I’ve found the problem. the worksheet_url protected method in table.rb uses CGI::escape to escape “special” characters. Problem is it replaces space characters with ‘+’ where is should be replaced with %20 for the URL path.

I’ve opened an issue in github.

0 Replies 0