Skip to content

Instantly share code, notes, and snippets.

@jaydonnell
Created July 31, 2011 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaydonnell/1117283 to your computer and use it in GitHub Desktop.
Save jaydonnell/1117283 to your computer and use it in GitHub Desktop.
class UsersController < ApplicationController::Base
respond_to :html, :xml, :json
def show
respond_with(@user = User.find(params[:id]))
end
def index
respond_with(@users = User.all)
end
def create
@user = User.create(params[:user])
respond_with(@user, :location => users_url)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment