Newbie question: Routing Issues since rails version update?

Hi there I wrote a small rails app for my university dept about a year or so ago to deal with mailing list generation and display of staff details and all was working fine up until last week when we did a version update. Im not someone who uses rails regularly and so Im a bit at a loss.

The normal functionality search and display of the rails program is fine, it searches and diplays user deatails without issues, but however when I try to “logon” to a session as the administrator to add a new user I get the following error:

ActiveRecord::RecordNotFound in UsersController#show

Couldn't find User with ID=login

RAILS_ROOT: /export/webserver/raid/htdocs/users

Application Trace | Framework Trace | Full Trace

/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:1620:in `find_one'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:1603:in `find_from_ids'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:620:in `find'
/export/cree/raid/htdocs/users/app/controllers/users_controller.rb:33:in `show'




Show session dump




So this appears to be an issue with routes.rb or some other issue of routing? I have not changed any of the routing configuration files at all and the format appears to comply with the current standards.

It looks tome like the directives

map.login ‘/login’, :controller => ‘sessions’, :action => ‘new’

map.logout ‘/logout’, :controller => ‘sessions’, :action => ‘destroy’

Are not working? And rails is trying to interpret “login” as if it were just another database row

Here is the routes.rb file

ActionController::Routing::Routes.draw do |map|

map.resources :users, :sessions

The priority is based upon order of creation: first created -> highest priority.

Sample of regular route:

map.connect ‘products/:id’, :controller => ‘catalog’, :action => ‘view’

Keep in mind you can assign values other than :controller and :action

Sample of named route:

map.purchase ‘products/:id/purchase’, :controller => ‘catalog’, :action => ‘purchase’

This route can be invoked with purchase_url(:id =>

Sample resource route (maps HTTP verbs to controller actions automatically):

map.resources :products

Sample resource route with options:

map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }

Sample resource route with sub-resources:

map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller

Sample resource route within a namespace:

map.namespace :admin do |admin|

# Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)

admin.resources :products


You can have the root of your site routed with map.root – just remember to delete public/index.html.

map.root :controller => “users”

See how all your routes lay out with “rake routes”

Install the default routes as the lowest priority.

map.connect ‘:controller/:action/:id’

map.connect ‘:controller/:action/:id.:format’

map.login ‘/login’, :controller => ‘sessions’, :action => ‘new’

map.logout ‘/logout’, :controller => ‘sessions’, :action => ‘destroy’


Previous Versions:
Rails version 2.2.3

Ruby version 1.8.6

New Versions:

Rails version 2.3.14

Ruby version 1.8.7

As Is ai Im not a day to day RoR programmer so any help or advice would be gratefully accepted.

Can you show us the code from the method show from this controller?

/export/cree/raid/htdocs/users/app/controllers/users_controller.rb:33:in `show'

Here it is… the normal display index and “show” functionality still works fine.

GET /users/1

GET /users/1.xml

def show

require ‘curb’

@user = User.find(params[:id])

if File.exist? “/home/#{@user.Personal_Web}/public_html/userdetails.html”


constructedurl = “{@user.Personal_Web}/userdetails.html

userurl = Curl::Easy.perform(constructedurl)

@userwebdetails = userurl.body_str


@userwebdetails = “No User Details Found”


if !@user.CentaurUID.blank?

@CentaurUIDValue = @user.CentaurUID

@CentaurUIDValue = @CentaurUIDValue.gsub(".", “=2E”)

@CentaurUIDValue = @CentaurUIDValue.gsub("@", “=40”)

@CentaurURLValue = “{@CentaurUIDValue}.include

@CentaurURL = Curl::Easy.perform(@CentaurURLValue)

@CentaurDetails = @CentaurURL.body_str


respond_to do |format|

format.html # show.html.erb

format.xml { render :xml => @user }



You can have the root of your site routed with map.root – just remember to delete public/index.html.

map.root :controller => “users”

I wonder if doing map.root and specifying only a controller (but not an action) does weird stuff. I’d try either changing this to add the appropriate action or move your login/logout routes higher up


In the logs I am seeing this, could this be the key? (pardon the pun)

"DEPRECATION WARNING: Giving :session_key to SessionStore is deprecated, please use :key instead. (called from new at /usr/lib64/ruby/gem/1.8/gems/actionpack-2.3.14/lib/action_controlle/middleware_stack.rb:72) "