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).
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---