Added airtable info

This commit is contained in:
Abhi Yerra 2017-10-10 19:04:48 +00:00
parent 432653cdb4
commit bc28417fff
9 changed files with 55 additions and 6 deletions

View File

@ -1,7 +1,4 @@
class RecentNewsController < ApplicationController
def index
render json: RecentNews.all.to_json
end
def show

View File

@ -0,0 +1,25 @@
class TablesController < ApplicationController
def recent_news
render json: RecentNews.all.to_json
end
def resources
render json: Resources.all.to_json
end
def support_services
render json: SupportServices.all.to_json
end
def gas_stations
render json: GasStations.all.to_json
end
def markets
render json: Markets.all.to_json
end
def shelters
render json: Shelters.all.to_json
end
end

View File

@ -0,0 +1,4 @@
class GasStations < Airrecord::Table
self.base_key = "appsj7gOti4YuE2v1"
self.table_name = "Gas Stations"
end

View File

@ -0,0 +1,4 @@
class Markets < Airrecord::Table
self.base_key = "appsj7gOti4YuE2v1"
self.table_name = "Markets"
end

View File

@ -0,0 +1,4 @@
class Resources < Airrecord::Table
self.base_key = "appsj7gOti4YuE2v1"
self.table_name = "Resources"
end

View File

@ -0,0 +1,4 @@
class Shelters < Airrecord::Table
self.base_key = "appsj7gOti4YuE2v1"
self.table_name = "Shelters"
end

View File

@ -0,0 +1,4 @@
class SupportServices < Airrecord::Table
self.base_key = "appsj7gOti4YuE2v1"
self.table_name = "Support Services"
end

View File

@ -1,5 +1,5 @@
Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
resources :recent_news
['recent_news', 'resources', 'support_services', 'gas_stations', 'markets', 'shelters'].each do |x|
get "/#{x}", to: "tables##{x}"
end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class TablesControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end