# Index controller showing routing error

I am new to rubies on rails. I have set the resource directive in my routes file.

resources :employees


Which creates the following routes

 root        /                                    employees#index
 employees     GET      /employees(.:format)          employees#index
              POST     /employees(.:format)          employees#create
 new_employee GET  /employees/new(.:format)      employees#new
 edit_employee GET  /employees/:id/edit(.:format) employees#edit
 employee     GET      /employees/:id(.:format)      employees#show
              PUT      /employees/:id(.:format)      employees#update
              DELETE   /employees/:id(.:format)      employees#destroy


But when I put / employees in the address bar, I get

No route matches {:controller=>"employees", :action=>"show"}


Even if / employees should call employees # index not employees # show

Where did I disappear here?



source to share

1 answer

Perhaps you have a reference in your layout or template like employee_path (not employees_path ). And you have this error.



All Articles