- require "rubygems"
- require "activerecord"
- ActiveRecord::Base.establish_connection(
- :adapter => "mysql",
- :host => "localhost",
- :username => "root",
- :database => "Contact")
- class Employee < ActiveRecord::Base
- set_table_name "employee"
- end
- account = Employee.new
- account.Name = "AAA"
- account.save
来源: http://www.phpxs.com/code/1007072/