Forcing specific controllers to load at startup

Hi,

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
maybe).

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
defined.

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

Cheers,
Bob


Bob H. – blogs at <http://www.recursive.ca/
hutch/>
Recursive Design Inc. – http://www.recursive.ca/
Raconteur – http://www.raconteur.info/
xampl for Ruby – http://rubyforge.org/projects/xampl/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs