ActiveRecord Without Rails


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. require 'rubygems'
  2. gem 'activerecord', '=2.1.2'
  3. require 'active_record'
  4.  
  5. ActiveRecord::Base.establish_connection(
  6. :adapter => "mysql",
  7. :host => "localhost",
  8. :username => "root",
  9. :database => "db_name"
  10. )
  11.  
  12. class Account < ActiveRecord::Base
  13. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.