I hereby claim:
- I am breefield on github.
- I am breefield (https://keybase.io/breefield) on keybase.
- I have a public key whose fingerprint is B286 EB99 80CE 619E 5C1D 8DA4 4FDD ED6F A310 5C0D
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'json' | |
| require 'pp' | |
| require 'open-uri' | |
| require 'cgi' | |
| require 'httparty' | |
| affiliate_id = 'olenaw-20' |
| "wow".downcase |
| { | |
| "animal": { | |
| "id": 1, | |
| "kind": "Lion", | |
| "waterhole_ids": [1, 2] | |
| }, | |
| "waterholes": [ | |
| { "id": 1, "name": "lots of water here" }, | |
| { "id": 2, "name": "so much h2o"} | |
| ], |
| { | |
| "animal": { | |
| "id": 1, | |
| "kind": "Lion", | |
| "waterhole_ids": [1, 2] | |
| }, | |
| "waterholes": [ | |
| { "id": 1, "name": "lots of water here" }, | |
| { "id": 2, "name": "so much h2o"} | |
| ], |
| class AnimalSerializer < ActiveModel::Serializer | |
| embed :ids, include: true | |
| attributes :id, :kind, :classification | |
| has_many :waterholes | |
| end |
| def index | |
| @animals = Animal.all | |
| respond_to do |f| | |
| f.html {} | |
| f.json { render json: @animals } | |
| end | |
| end |
| def index | |
| @animals = Animal.all | |
| render json: @animals | |
| end | |
| def show | |
| render json: @animal | |
| end |
| def index | |
| @animals = Animal.all | |
| render json: @animals | |
| end |