Re: Environment specific application configuration values

Tim Harding
Wed, 01 Nov 2006 12:35:10 -0000

Okay, so figured out that you add something like:

GOOGLE_MAPS_API_KEY = "somekeyvalue"

to the end each of the config/environments/*.rb files

and then call:

<%= GOOGLE_MAPS_API_KEY %>

Pretty simple but how do I set a default value for all environments and
then override for only those that require it? It seems that
environment.rb overwrites the environments/*.rb files.

Thanks,
-Tim

Tim Harding wrote:
> Hi, I''m using Google Maps API in my app and that requires a
specific
> API key (a string) for each URI it is accessed from.
>
> I''d like to put a specific key into each of the development.rb and
> production.rb files and pick up a default "localhost:3000" key
from
> environment.rb and make that available somehow to print in a view.
>
> What''s the rails way to do this type of thing?
>
> Many thanks,
>
> -Tim


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---