Forum: Ruby on Rails How to require a regular module into my controller?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Wes G. (Guest)
on 2006-04-25 02:05
I created a modules directory under my app. root (RAILS_ROOT/app)

I'm trying to "require in" a module in that directory into my

I tried require 'modules/module.rb'
I tried require "#{RAILS_ROOT}/app/modules/ESimplyUtil"

The module file is in modules/ESimplyUtil.rb.  Is that the right name?

Neither of these works.

How can I successfully require in my module?

Bakki K. (Guest)
on 2006-04-25 17:23
(Received via mailing list)
Rails loads everything in {$RAILS_ROOT}/lib automatically(then  you
dont' have to explicitly require it). That's where I have my app wide
library code.  If you want to require a gem or ruby library you can do
it in app/controllers/application.rb which then will be available
application wide. Atleast this has worked for me.

This topic is locked and can not be replied to.