Sha256: d13644a84f9b73528e4865601cadb9039e073b4e277373ff553f0a4e1f89b68a

Contents?: true

Size: 872 Bytes

Versions: 5

Compression:

Stored size: 872 Bytes

Contents

class ContactsController < ApplicationController

  respond_to :html

  # GET /contacts
  def index
    @contacts = Contact.all
    respond_with(@contacts)
  end

  # GET /contacts/new
  def new
    @contact = Contact.new
    respond_with(@contact)
  end

  # GET /contacts/:id/edit
  def edit
    @contact = Contact.find(params[:id])
    respond_with(@contact)
  end

  # POST /contacts
  def create
    @contact = Contact.create(params[:contact])
    respond_with(@contact, :location => contacts_path)
  end

  # PUT /contacts
  def update
    @contact = Contact.find(params[:id])
    @contact.attributes = params[:contact]
    @contact.save
    respond_with(@contact, :location => contacts_path)
  end

  # DELETE /contacts/:id
  def destroy
    @contact = Contact.find(params[:id])
    @contact.delete
    respond_with(@contact, :location => contacts_path)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
formula-1.0.0 test/dummy/app/controllers/contacts_controller.rb
formula-0.3.9 test/dummy/app/controllers/contacts_controller.rb
formula-0.3.8 test/dummy/app/controllers/contacts_controller.rb
formula-0.3.7 test/dummy/app/controllers/contacts_controller.rb
formula-0.3.6 test/dummy/app/controllers/contacts_controller.rb