I created a rails app with the -O option (i.e. without ActiveRecord). But now I want to add active record to it. How can I accomplish that?
Inside of config/application.rb
you should see where the ActiveRecord
railtie is commented out (see below).
# Pick the frameworks you want:
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
Uncomment it.
Also make sure to add a database.yml
file and the a database adapter gem (e.g. sqlite3
) to your Gemfile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With