Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 63bf611371
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (32 sloc) 0.748 kb
class PeopleController < ApplicationController
before_filter :find_resource, :only => [:show, :destroy, :edit, :update]
def index
@people = Person.all
end
def show
end
def new
@person = Person.new
end
def create
@person = Person.new(params[:person])
if @person.save
redirect_to @person, :notice => "Successfully created person."
else
render :action => 'new'
end
end
def edit
end
def update
if @person.update_attributes(params[:person])
redirect_to @person, :notice => "Successfully updated person."
else
render :action => 'edit'
end
end
def destroy
@person.destroy
redirect_to people_url, :notice => "Successfully destroyed person."
end
end
Jump to Line
Something went wrong with that request. Please try again.