Forcing specific controllers to load at startup

Bob Hutchison
2007-02-03T18:17:40Z

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 Hutchison                  -- 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/>




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---