class AddressesController < ApplicationController # GET /addresses # GET /addresses.xml def index @addresses = Geo::Address.find(:all) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @addresses } end end # GET /addresses/1 # GET /addresses/1.xml def show @address = Geo::Address.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @address } end end # GET /addresses/new # GET /addresses/new.xml def new @address = Geo::Address.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @address } end end # GET /addresses/1/edit def edit @address = Geo::Address.find(params[:id]) end # POST /addresses # POST /addresses.xml def create @address = Geo::Address.new(params[:address]) respond_to do |format| if @address.save flash[:notice] = 'Address was successfully created.' format.html { redirect_to(address_path(@address)) } format.xml { render :xml => @address, :status => :created, :location => @address } else format.html { render :action => "new" } format.xml { render :xml => @address.errors, :status => :unprocessable_entity } end end end # PUT /addresses/1 # PUT /addresses/1.xml def update @address = Geo::Address.find(params[:id]) respond_to do |format| if @address.update_attributes(params[:address]) flash[:notice] = 'Address was successfully updated.' format.html { redirect_to(address_path(@address)) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @address.errors, :status => :unprocessable_entity } end end end # DELETE /addresses/1 # DELETE /addresses/1.xml def destroy @address = Geo::Address.find(params[:id]) @address.destroy respond_to do |format| format.html { redirect_to(addresses_url) } format.xml { head :ok } end end end