Common global resources

hello!

I’m looking for the best option to declare global variables and
constants in my web application, that can be accessed from anywhere of
my program.

I decided to declare the global constants in the ApplicationController,
like this:

class ApplicationController < ActionController::Base
PROJECT_TYPE = 1
end

and accessing this constant in the next way (index.rhtml):

<%= ApplicationControll::PROJECT_TYPE %>

but I guess is not the best option to do this.

There is another way???

thank you very much (and sorry for my english).

Gonzalo,

You can create a hash in environnment.rb:

CONFIG = {
:page_size => 30,
}

and then use it anywhere in your app: CONFIG[:page_size]

Jean-Etienne