0.0
No commit activity in last 3 years
No release in over 3 years
Airtable client from Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.0.9
>= 4.0.0
 Project Readme

AirtableRails

AirtableRails is an easy and safe way to access Airtable. It handles client creation and app selection. Write methods are restricted to production and will write to log in other environments.

Usage

ENV["AIRTABLE_API_KEY"] = "key1234567890"
ENV["AIRTABLE_APP_ID"] = "app1234567890"

table = AirtableRails::Table.new("Table name")

table acts like an Airtable::Table as described here: https://github.com/Airtable/airtable-ruby.

create_from_hash

Instead of creating records in two steps:

record = Airtable::Record.new(:name => "Sarah Jaine", :email => "sarah@jaine.com")
table.create(record)

you can use create_from_hash to do both in a single call:

table.create_from_hash(:name => "Sarah Jaine", :email => "sarah@jaine.com")

Enabling write methods in other environments

By default, write methods (create, update, destroy) only call Airtable if the Rails environment is production.

You can disable this behavior by passing the force_write option to the initializer:

table = AirtableRails::Table.new("Table name", force_write: true)