In routes.rb
direct :blog do
'http://blog.yourdomain.com/'
end
direct :api do
Rails.env.production? ? ENV['API_URL'] : 'http://localhost:4000'
end
In views/controllers
blog_url # => 'http://blog.yourdomain.com/'
api_url # => 'http://localhost:4000'
Comments