I have a problem to upgrade my routes.rb file.
I converted this route:
map.resource :index, :controller => "users", :action => "index"
By
resource :index, :to => "users#index"
There is no error raised but the page does not display correctly.
Does anyone have an idea?
Update:
I have this instruction:
resources :users
Here is my routes.rb file:
JNetExams::Application.routes.draw do |map|
match 'login', :to => 'user_sessions#new', :as => 'login'
match 'logout', :to => 'user_sessions#destroy', :as => 'logout'
root :to => 'user_sessions#new'
resources :groups
resources :students
resources :users
resources :responses
#map.resource :index, :controller => "users", :action => "index"
resource :index, :to => "users#index"
map.resource :account, :controller => "users"
#resource :account, :controller => "users"
resource :user_session
resource :student
resource :user
map.resource :professor, :controller => "professors", :action => "index"
#resource :professor, :to => "professors#index"
map.connect ':controller/:action/:id'
#match ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
#match ':controller/:action/:id.:format'
#map.connect '*url', :controller => :users, :action => :index
match '*url', :to => "users#index"
#map.connect '/user_sessions/show', :controller => "user_sessions", :action => "show"
match '/user_sessions/show', :to => "user_sessions#show"
How can I upgrade this routes file to Rails 3?
resources :indexprovides paths for an index resource. Sonew_index_pathwill point to thenewaction in theIndexController. If you do not have an index resource, you should not be using resources to define a path to"users#index". This path is already given to you asusers_paththroughresources :users. If you are looking to set an index page for your application, you can achieve that usingroot :to => "users#index".The problem of things not displaying correctly is vague and I employ you to throw more light on that. We are here to help after all.