Tuesday, December 28, 2010

Configure Ruby on Rails with no database


Although Rails is intended for creating database-backed web applications, this example is simple enough that it doesn’t require one. In this case, you need to edit the enviroment.rb configuration file to indicate that your application does not use a database. It is possible to disable loading ActiveRecord by making a simple modification to environment.rb:
1. Open ‘/config/environment.rb’ file in a text editor.
2. Remove the pound character (#) in front of line 21 to uncomment it so that it reads as:
config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
ActiveRecord supports database access for Rails applications. When you create model objects, you will most likely base them on ActiveRecord::Base.
3. Save the file.

No comments:

Post a Comment