small medium large xlarge

10 Nov 2009, 17:21
Kent White (1 post)

I have a customers table with an autoincrement id.

class CreateCustomers < ActiveRecord::Migration def self.up create table :customers do |t| t.integer :customer_num primary key autoincrement t.string :fname end end

In my new form how do I get :customer_num to have the next value? <% form_for(@customer) do |f| %>

Customer num
<%= f.text_field :customer_num %>

You must be logged in to comment