Forum: Ruby on Rails Forcing specific controllers to load at startup

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.
E3c79c779c0b390049289cdfe7cb9705?d=identicon&s=25 Bob Hutchison (Guest)
on 2007-02-03 19:19
(Received via mailing list)

I've got a problem that's been nagging at me for about a year now.
Every now and again I end up being burned by it. I've never seen
mention of it, and I can't find anything using google (wrong words

Anyway. Say you have some data specifically related to a controller
that you want initialised. Ideally this data would be specified in
that controller. Now let's say that other controller/views that
provide links to the first controller need to know this information
to act rationally. The trouble is that the first controller is not
loaded until a user does something that requires it.

I have been unsuccessful at getting the controller to load through
any coding 'action'. Makes me think I haven't come across the way
that works.

No luck with require_dependency... it leaves constants unexpectedly

I have ended up sending an HTTP request at start up to the
controller. This works, but surely there's a better way?


Bob Hutchison                  -- blogs at <
Recursive Design Inc.          -- <>
Raconteur                      -- <>
xampl for Ruby                 -- <>
This topic is locked and can not be replied to.