[Rails] Setting constants based on TLD
Our app currently has some constants set in the environment.rb file using Object.const_set "ProductionDomain", "mydomain.com" and some other domain related constants that are based off of this initial constant.
We are now going to be offering a .fr domain in addition to .com so I need to make these constants dynamic based on which TLD a person may be on.
My thought was that maybe I should move these constants into their own file in the initializers folder and can then check whether the user is on the .com TLD or .fr
Is there a better way to handle this? I couldn't find a way to do it in the environment.rb file so I'm thinking this other approach may be the way to go.
We are on Rails 2.3.14, so any options need to be compatible with that version.
Thank you,
Ben
-- 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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/GCAisT6ZTJ4J.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home