Skip to content
Versioning API comparison
Ruby JavaScript CoffeeScript
Pull request Compare This branch is 2 commits ahead of railscasts:master.
Failed to load latest commit information.
store-after-versioncake versioned app using version cake Oct 14, 2012
store-after fixing seeds file and changing attr_accessible released_on to release… Oct 14, 2012
store-before versioned app using version cake Oct 14, 2012

RailsCasts Episode #350: REST API Versioning

Requires Ruby 1.9.2 or higher.

Commands used in this episode

rails g migration change_products_released_on
rake db:migrate
cp -R app/controllers/api/v1 app/controllers/api/v2
curl -H 'Accept: application/vnd.example.v1' http://localhost:3000/api/products

Version Cake Implementation

See for more details on the gem.

curl -H 'Accept: application/json; api_version=1' http://localhost:3000/products.json
Something went wrong with that request. Please try again.