I am attempting to deploy my RoR 3. application on the server that's not based on Passenger. Everything labored fine until I made the decision to make use of an Apache virtual folder for my application server. Around the production atmosphere Now i need to by hand add the folder title before all URL, for example utilizing a :host => "myServer/myApp" in most url_for calls. It really works but it's painful. Does anybody know a pleasant method to automate it?    

Here things i attempted unsuccessfully to date after reading through many posts:

  • define default_url_for in application.rb, but didn't have effect

  • I discovered some indication to define url_for and call super from the inside it. No effect either

Interesting help


The fast and dirty option would be to wrap everything in the scope block inside your config/routes.rb file:

scope 'myApp' do  # replace 'myApp' with the virtual folder name

  resources :users
  # ...