Skip to content

Instantly share code, notes, and snippets.

@ckumar1
ckumar1 / SmartFridge-Rails Login API example.json
Last active August 29, 2015 14:01
JSON request/response structure for successful authentication and registration via the API
//POST https://fridgepantry.herokuapp.com/api/access
// Request
{
"email": "user@email.com",
"password": "password123"
}
// Response
/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /usr/bin/irb
Switch to inspect mode.
>> {first: "", last: ""}
{:first=>"", :last=>""}
>> person1, person2, person3 = {first: "", last: ""}
{:first=>"", :last=>""}
>> person2[:first]
NoMethodError: undefined method `[]' for nil:NilClass