title: Production Rails 3 Routes not working the same as Development
body: <p>I am currently trying to get my Ruby (1.8.7) on Rails (3.0.9) application running in a production environment.  However on transferring across to the production environment I am having major problems with my routes.  For instance in my code I referred to </p>
  
  <pre><code>user_path()
  </code></pre>
  
  <p>But in production I had to change that to</p>
  
  <pre><code>users_path()
  </code></pre>
  
  <p>That seems to be working except where it is used in</p>
  
  <pre><code>users_path(user)
  </code></pre>
  
  <p>Which produces the URL</p>
  
  <pre><code>http://whatwillworkforme.com/users?format=myuser
  </code></pre>
  
  <p>Whereas development would produce:</p>
  
  <pre><code>http://whatwillworkforme.com/users/myuser
  </code></pre>
  
  <p>My routes are shown below.  I am using code the Smartr project (https://github.com/dkd/smartr) so I am not that familiar with Rails 3 routes or why particular decisions were made.</p>
  
  <pre><code>WhatWillWorkForMeCom::Application.routes.draw do
  
    devise_for :users, :controllers =&gt; { :registrations =&gt; "registrations",
                                     :passwords      =&gt; "passwords",
                                     :sessions      =&gt; "sessions" }
    namespace :admin do
      resources :comments
      resources :treatments
      resources :conditions
      resources :users
    end
  
    match "/conditions/page/:page", :to =&gt; "conditions#index"
    match "/conditions/hot(/:page)", :to =&gt; "conditions#hot"
    match "/conditions/active(/:page)", :to =&gt; "conditions#active"
    match "/conditions/untreated(/:page)", :to =&gt; "conditions#untreated"
    match "/conditions/tagged/:tag(/:page)", :to =&gt; "condition#index"
  
    match "sitemap/" =&gt; "sitemap#index"
  
    match 'contact_us' =&gt; 'site#contact_us_new', :as =&gt; 'contact_us', :via =&gt; :get
    match 'contact_us' =&gt; 'site#contact_us_create', :as =&gt; 'contact_us', :via =&gt; :post
  
    resources :conditions, :except =&gt; [:show, :edit] do
  
      member do
        put :update_for_toggle_acceptance
        put :update_for_toggle_decline
      end
  
      collection do
        get :hot
        get :active
        get :untreated
        get :search
      end
    end
  
    match "/conditions/:id(/:friendly_id)", :to =&gt; "conditions#show", :as =&gt; :condition
    match "/conditions/:id/:friendly_id/edit", :to =&gt; "conditions#edit"
    match "/site/terms_and_conditions", :to =&gt; "site#terms_and_conditions"
  
    scope "/conditions/:condition_id/:friendly_id/" do
      get "treatment/:id/edit", :to =&gt; "treatments#edit", :as =&gt; :edit_condition_treatment
      put "treatment/:id", :to =&gt; "treatments#update", :as =&gt; :condition_treatment
      post "treatments", :to =&gt; "treatments#create", :as =&gt; :condition_treatments
    end
  
    match "/admin", :to =&gt; "admin#index"
  
    resources :comments
    resources :tags, :only =&gt; [:index]
    resources :votes, :only =&gt; [:create]
  
    resources :users, :except =&gt; [:destroy] do
  
      collection do
        get :who_is_online
        get :search
      end
  
      member do
        get :reputation
      end
  
      resources :bookmarks, :only =&gt; [:index]
  
    end
  
    resources :bookmarks, :only =&gt; [:toggle] do
      member do
        post :toggle
        get :toggle
      end
    end
  
    match "errors/routing", :to =&gt; "errors#routing"
  
    namespace :api do
      namespace :v1 do
        resources :conditions, :only =&gt; [:index]
        resources :users, :only =&gt; [:index]
      end
    end
  
    root :to =&gt; 'site#index'
    match '*a', :to =&gt; 'errors#routing'
  end
  </code></pre>
  
  <p>Rake Routes (as asked for) is</p>
  
  <pre><code>        new_user_session GET    /users/sign_in(.:format)         {:action=&gt;"new", :controller=&gt;"sessions"}
              user_session POST   /users/sign_in(.:format)         {:action=&gt;"create", :controller=&gt;"sessions"}
      destroy_user_session GET    /users/sign_out(.:format)        {:action=&gt;"destroy", :controller=&gt;"sessions"}
             user_password POST   /users/password(.:format)        {:action=&gt;"create", :controller=&gt;"passwords"}
         new_user_password GET    /users/password/new(.:format)    {:action=&gt;"new", :controller=&gt;"passwords"}
        edit_user_password GET    /users/password/edit(.:format)   {:action=&gt;"edit", :controller=&gt;"passwords"}
                           PUT    /users/password(.:format)        {:action=&gt;"update", :controller=&gt;"passwords"}
  cancel_user_registration GET    /users/cancel(.:format)          {:action=&gt;"cancel", :controller=&gt;"registrations"}
         user_registration POST   /users(.:format)                 {:action=&gt;"create", :controller=&gt;"registrations"}
     new_user_registration GET    /users/sign_up(.:format)         {:action=&gt;"new", :controller=&gt;"registrations"}
    edit_user_registration GET    /users/edit(.:format)            {:action=&gt;"edit", :controller=&gt;"registrations"}
                           PUT    /users(.:format)                 {:action=&gt;"update", :controller=&gt;"registrations"}
                           DELETE /users(.:format)                 {:action=&gt;"destroy", :controller=&gt;"registrations"}
         user_confirmation POST   /users/confirmation(.:format)    {:action=&gt;"create", :controller=&gt;"devise/confirmations"}
     new_user_confirmation GET    /users/confirmation/new(.:format){:action=&gt;"new", :controller=&gt;"devise/confirmations"}
                           GET    /users/confirmation(.:format)    {:action=&gt;"show", :controller=&gt;"devise/confirmations"}
  who_is_online_users GET    /users/who_is_online(.:format)      {:action=&gt;"who_is_online", :controller=&gt;"users"}
         search_users GET    /users/search(.:format)             {:action=&gt;"search", :controller=&gt;"users"}
      reputation_user GET    /users/:id/reputation(.:format)     {:action=&gt;"reputation", :controller=&gt;"users"}
       user_bookmarks GET    /users/:user_id/bookmarks(.:format) {:action=&gt;"index", :controller=&gt;"bookmarks"}
                users GET    /users(.:format)                    {:action=&gt;"index", :controller=&gt;"users"}
                      POST   /users(.:format)                    {:action=&gt;"create", :controller=&gt;"users"}
             new_user GET    /users/new(.:format)                {:action=&gt;"new", :controller=&gt;"users"}
            edit_user GET    /users/:id/edit(.:format)           {:action=&gt;"edit", :controller=&gt;"users"}
                 user GET    /users/:id(.:format)                {:action=&gt;"show", :controller=&gt;"users"}
                      PUT    /users/:id(.:format)                {:action=&gt;"update", :controller=&gt;"users"}
  </code></pre>