Sorry, I should have posted the entire method.

> Where did "Please try again" come from? Is this your own exception 
> handler? Try commenting that out so you get a full backtrace.

def import_irb_file
     # set file name
      file = params[:irb][:file]
      rowcount = 0

      Irb.transaction do
        # using ":headers => true", this will read but skip the header 
row in the .csv file.
        FasterCSV.parse(file, :headers => true) do |row|
          # set row data to an Array
          f = row.fields

          Irb.create("irb_number" => f[0],
                     "pi_full_name" => f[1] )
          rowcount+=1
        end
      end

      # if successful then display, then redirect to index page
      flash[:notice] = "Successfully added #{rowcount} IRB record(s)."
      redirect_to :action => :index

    rescue => exception
      file_name = params[:irb]['file'].original_filename
      file_parts = params[:irb]['file'].original_filename.split('.')
      ext = file_parts[1]

      if ext != 'csv'
        error = "CSV file is required"
      else
        error = ERB::Util.h(exception.to_s) # get the error and HTML 
escape it
      end
      # If an exception in thrown, the transaction rolls back and we end 
up in this
      # rescue block

      flash[:error] = "Error adding projects to IRB table. (#{error}). 
Please try again."

      redirect_to :controller => 'irbs', :action => 'new'

  end

I will check for any AR methods for inspecting.

thanks again.

John
-- 
Posted via http://www.ruby-forum.com/.