title: How to deploy Rails 3.1 app in a subdirectory
body: <p>How do I configure a Rails 3.1 application to run under a specific directory such as "/r"? </p>
  
  <p>I tried in config.ru:</p>
  
  <pre><code>map '/r' do
      run Debtor::Application
  end
  </code></pre>
  
  <p>but that just returned "Not Found: /r"</p>
  
  <p>To get it to work I had to enclose all routes in a scope:</p>
  
  <pre><code>scope '/r' do 
      #routes
  end
  </code></pre>
  
  <p>and to add the following line to config/applcation.rb</p>
  
  <pre><code>config.assets.prefix = "/r/assets"
  </code></pre>
  
  <p>and to move my jquery ui css files from /stylesheets to /r/stylesheets. </p>
  
  <p>this seems too complicated. isn't there an easier way? and why isn't my config.ru setting working?</p>
  
  <p>my use case is to have a rails powered ajax backend for a wordpress server.   </p>