Require file in rails


#1

Hi,
I have a file called dbcon.rb that I put in the config directory.

I want to call it from rake, and I was using
require ‘config/dbcon.rb’

This was allowing me to access the classes in this file.

Somehow, the require command cannot find this file anymore. Is there a
path
convention in rails? How do I use require from different parts of my
application?

Sincerely,
Kaushik


#2

Kaushik katari wrote:

my application?
You could move it to the lib directory, or write
require “#{RAILS_ROOT}/config/dbcon.rb”


Rails Wheels - Find Plugins, List & Sell Plugins -
http://railswheels.com