Help

Re: Airtable-ruby gem problems

1380 0
cancel
Showing results for 
Search instead for 
Did you mean: 

If there are any other Ruby on Rails devs out there that could help me out, I’m trying to use the airtable-ruby gem to post data from a custom form to an airtable base.

I’m new to web development, self-taught, and working alone, so I’m sure my code is a mess and I’m doing things all wrong, but I feel like I have this set up in a way that it should be working. I have as much of it stripped down to the bare bones as possible, but I still can’t figure out what’s failing.

Here’s my controller:
Screen Shot 2018-04-12 at 5.28.11 PM.png

The form:
image.png

The log results from submitting:
Screen Shot 2018-04-12 at 5.34.50 PM.png

My table:
image.png

I worked on this for several hours today and cannot for the life of me figure out why it won’t submit records. If you can offer any help, I’d be much obliged!

3 Replies 3
Andrew_Johnson1
8 - Airtable Astronomer
8 - Airtable Astronomer

I have not used the Ruby library in the past…As I generally use the API directly via the REST interface so you might want to give that a go…
A quick Google search for “rest api calls ruby” will give you some helpful pointers…

Each Base has its own set of “curl” calls, so you would essential need to “convert” those raw curl calls into HTTP calls using a Ruby HTTP client…

I agree its a bit of a tiresome solution, but in case I have some free time later on today I will go over your code and figure out where you are going wrong…

Well, I couldn’t get the gem to work at all - github issues suggested other people have had trouble as well.

So I resorted to using the built in Ruby Net::HTTP.post method and finally got it working.

Now I’m trying to figure out what types of fields I can submit data to and what kind of form helpers I can use to generate that data :persevere:

For the benefit of future readers with this same issue - I found a gem called decanter that will transform the strings you get back from web forms into a data type you define, so that you can hit Airtable’s api to submit to number and checkbox fields :+1:t2: