Created
March 12, 2012 16:14
-
-
Save nchapman/2023064 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 OrganizationsController < ApplicationController | |
def index | |
@organizations = Organization.all | |
respond_with(@organizations) | |
end | |
def show | |
@organization = Organization.find(params[:id]) | |
respond_with(@organization) | |
end | |
def new | |
@organization = Organization.new | |
respond_with(@organization) | |
end | |
def edit | |
@organization = Organization.find(params[:id]) | |
end | |
def create | |
@organization = Organization.new(params[:organization]) | |
@organization.save | |
respond_with(@organization) | |
end | |
def update | |
@organization = Organization.find(params[:id]) | |
@organization.update_attributes(params[:organization]) | |
respond_with(@organization) | |
end | |
def destroy | |
@organization = Organization.find(params[:id]) | |
@organization.destroy | |
respond_with(@organization) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment