Sha256: 0e64d67ae26f4a85036801551e883ec78152a75cf3ea482c8ab18de71e9125f0

Contents?: true

Size: 1.9 KB

Versions: 21

Compression:

Stored size: 1.9 KB

Contents

class PeopleController < ApplicationController
  # GET /people
  # GET /people.xml
  def index
    @people = Person.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @people }
    end
  end

  # GET /people/1
  # GET /people/1.xml
  def show
    @person = Person.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @person }
    end
  end

  # GET /people/new
  # GET /people/new.xml
  def new
    @person = Person.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @person }
    end
  end

  # GET /people/1/edit
  def edit
    @person = Person.find(params[:id])
  end

  # POST /people
  # POST /people.xml
  def create
    @person = Person.new(params[:person])

    respond_to do |format|
      if @person.save
        format.html { redirect_to(@person, :notice => 'Person was successfully created.') }
        format.xml  { render :xml => @person, :status => :created, :location => @person }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @person.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /people/1
  # PUT /people/1.xml
  def update
    @person = Person.find(params[:id])

    respond_to do |format|
      if @person.update_attributes(params[:person])
        format.html { redirect_to(@person, :notice => 'Person was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @person.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /people/1
  # DELETE /people/1.xml
  def destroy
    @person = Person.find(params[:id])
    @person.destroy

    respond_to do |format|
      format.html { redirect_to(people_url) }
      format.xml  { head :ok }
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
fixture_background-0.9.10.1 test/rails3/app/controllers/people_controller.rb
jtable-rails-0.2.5 spec/support/rails_app/app/controllers/people_controller.rb
jtable-rails-0.2.4 spec/support/rails_app/app/controllers/people_controller.rb
jtable-rails-0.2.3 spec/support/rails_app/app/controllers/people_controller.rb
jtable-rails-0.2.2 spec/support/rails_app/app/controllers/people_controller.rb
jtable-rails-0.2.1 spec/support/rails_app/app/controllers/people_controller.rb
jtable-rails-0.2.0 spec/support/rails_app/app/controllers/people_controller.rb
fixture_background-0.9.10 test/rails3/app/controllers/people_controller.rb
fixture_background-0.9.9 test/rails3/app/controllers/people_controller.rb
fixture_background-0.9.8 test/rails3/app/controllers/people_controller.rb
fixture_background-0.9.7 test/rails3/app/controllers/people_controller.rb
fixture_background-0.9.6 test/rails3/app/controllers/people_controller.rb
fixture_background-0.9.5 test/rails3/app/controllers/people_controller.rb
fixture_background-0.9.4 test/rails3/app/controllers/people_controller.rb
jtable-rails-0.1.4 spec/support/rails_app/app/controllers/people_controller.rb
jtable-rails-0.1.3 spec/support/rails_app/app/controllers/people_controller.rb
jtable-rails-0.1.2 spec/support/rails_app/app/controllers/people_controller.rb
jtable-rails-0.1.1 spec/support/rails_app/app/controllers/people_controller.rb
jtable-rails-0.1.0 spec/support/rails_app/app/controllers/people_controller.rb
fixture_background-0.9.3 test/rails3/app/controllers/people_controller.rb