Report abuse


			
class ContactsController < ApplicationController
    def new
        @page_title = "New Contact"
    end

    def create
        @contact = Contact.new(params[:contact])
        @phone_numbers = params[:phone_numbers]
        for phone_number in @phone_numbers
            @contact.phone_numbers << phone_number
        end
        @contact.save

        if not @contact.errors.empty?
            render :action => 'new'
       else
            redirect_to :action => 'show', :id => @contact.id
        end
    end
end