Newbe:Where declare constants visible in view & controller?


#1

I am using some constants that should be visible in the controller and
in a view.

Declaring the constant in the controller does not make the constant
visible in the view.

So my question:
Where can I declare the constant to be visible in all views and
controllers ?

Thanks a lot in advance
Christian


#2

Hi,
I know its a simple question - but maybe someone can help :slight_smile:
Thanks
Christian

Christian Neuhaus wrote:

I am using some constants that should be visible in the controller and
in a view.

Declaring the constant in the controller does not make the constant
visible in the view.

So my question:
Where can I declare the constant to be visible in all views and
controllers ?

Thanks a lot in advance
Christian


#3

Set a instance attribute in the controller via before_filter.


– Tom M.


#4

On Jan 27, 2006, at 12:15 AM, Christian Neuhaus wrote:

Declaring the constant in the controller does not make the constant
visible in the view.

So my question:
Where can I declare the constant to be visible in all views and
controllers ?

Thanks a lot in advance
Christian

Christain-

I usually put my constants in the environment.rb file. This way they

will be available everywhere in the whole app. just remember to
restart the webserver after makig changes to them.

Cheers-
-Ezra Z.
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
removed_email_address@domain.invalid