Created
July 31, 2011 22:22
-
-
Save jaydonnell/1117283 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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