About a simple insert

It sounds like you should establish an association between the two models:

  class Client < ActiveRecord::Base      has_many :details   end

  class Detail < ActiveRecord::Base     belongs_to :client   end

This would require a client_id column in the details table.

Then, when the form is submitted, you would do something like:

  client = Client.new(params[:client])   client.details.build(params[:detail])   client.save

The one save inserts both the clients and details rows.

HTH

Oh, I see what you're saying.

You should keep two separate objects for the purpose of the form:

(in controller)

   @client = Client.new    @detail = Detail.new

Then in the view:

   <%= text_field :detail, :name %>

Before the save, you would add the detail to the client:

   @client.details << @detail    @client.save