I have used this guide Install Ruby on Rails on Ubuntu to install Ruby on Rails
Also this other tutorial Restful Rails API, Just Add Water for the API basics
To start the server just execute start_server.sh
I have used a sqlLite3 database, the schema is included.
Execute bin/setup
to install dependencies and create the database
There are two resources, tweets and users
The route for them are
- /api/users
- /api/tweets
You can create an user making a POST request to /api/users
with the following parameters
{"name": "John Doe"}
And get them going to /api/users.json
you should include the format, only supported json and xml
POST request to /api/tweets
with the following parameters
{"content": "First Tweet", "user_id": 1}
And get them going to /api/tweets.json
You can filter them just passing the user id in the query string
/api/tweets.json?user_id=1