Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

oestrich/hypermedia_rails

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
app
 
 
 
 
db
 
 
doc
 
 
lib
 
 
log
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Hypermedia API with Rails

This is a Hypermedia API example in Rails.

It uses several cool gems that are good for hypermedia and/or APIs:

  • active_model_serializers
  • rspec_api_documentation
  • raddocs

Getting going

Here's how to give this a try. First, you'll need Postgres installed and running. Next, run these commands:

$ git clone https://github.com/oestrich/hypermedia_rails.git
$ cd hypermedia_rails
$ bundle
$ RAILS_ENV=test bundle exec rake db:create db:migrate
$ RAILS_ENV=development bundle exec rake db:create db:migrate
$ bundle exec rake spec

You should see all the tests pass.

Hypermedia client

A basic example of using hypermedia is included via Faraday. The script will boot up it's own server, create a user and order, and finally show the order. You should be able to change the orders url and the script will continue to work, providing its using hypermedia.

To try it, just

$ bundle exec ruby hypermedia.rb

About

An example Rails app with a hypermedia API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published