APIs are becoming an essential feature of modern web applications. Rails does a good job of helping your application provide an API using the same MVC structure you're accustomed to.
Let's work with the following example controller:
class ArticlesController < ApplicationController