views:

24

answers:

1

I have a program that makes calls to an internal web API. However when we're doing development work on the sites we don't want the program to call our production web API but the staging version of the Web API. What's the best way to do this in rails?

I feel I should be assigning some sort of variable in development.rb and one in production.rb

Thanks

A: 

Yes, just add a variable to development.rb and production.rb like:

OUR_API_URL = "http://somepath"

Then you can use OUR_API_URL in your code.

John Drummond