twairball/yrwg-test-api — pull request #12 by twairball (2014-04-21 09:55:28+00:00)
Title: Login

Controllers with authentication:

````ruby
class HelloController < ApplicationController
before_filter :authenticate_user_from_token!
before_filter :authenticate_user!

....
end
````

Create a user and test ````authentication_token````:

````ruby
u = User.new
u.email = 'hello@foo.com'
u.password = 'nba123123'
u.password_confirmation = 'nba123123'
u.save
````
Test authentication token:
````
u.authentication_token
````

Test api by:

````
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-API-TOKEN: ' -H 'X-API-EMAIL: '
````