camping

What's the base URL for my app?

自闭症网瘾萝莉.ら 提交于 2019-12-11 01:38:12
问题 In Camping/Rack, how can I get the base URL for my app? I want to know so I can put it in an email it sends. It might be (in development) or http://localhost:9292 or http://localhost:80/game or in production http://fancy-snake.heroku.com 回答1: Camping has a helper called URL which returns the absolute URL to your app: URL() # => #<URL:http://test.ing/blog/> URL() + "view/12" # => #<URL:http://test.ing/blog/view/12> URL("/view/12") # => #<URL:http://test.ing/blog/view/12> 回答2: So far I have url