Skip to content

alexgt9/Rails-REST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic RESTful API using Ruby on Rails

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

Server

To start the server just execute start_server.sh

Database

I have used a sqlLite3 database, the schema is included. Execute bin/setup to install dependencies and create the database

Resources

There are two resources, tweets and users

The route for them are

  • /api/users
  • /api/tweets

Create users

You can create an user making a POST request to /api/users with the following parameters

{"name": "John Doe"}

Get users

And get them going to /api/users.json you should include the format, only supported json and xml

Create tweets

POST request to /api/tweets with the following parameters

{"content": "First Tweet", "user_id": 1}

Get tweets

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

About

Basic RESTful API using Ruby on Rails

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published