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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-04-25 00: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
controller.

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?

Thanks,
Wes
8acba6d057b3f0c2c16cca95ad36881b?d=identicon&s=25 Bakki Kudva (bakki)
on 2006-04-25 15: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.

-bakki
This topic is locked and can not be replied to.