# Routing Error No route matches "/employee/list" with {:method=\>:get}

**URL:** <https://www.ruby-forum.com/t/routing-error-no-route-matches-employee-list-with-method-get/141156>\
**Category:** Rails\
**Created:** [June 22, 2008, 11:42pm UTC](https://www.ruby-forum.com/t/routing-error-no-route-matches-employee-list-with-method-get/141156 "2008-06-22T23:42:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhiguang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/54ee81/32.png) [@zhiguang](https://www.ruby-forum.com/u/zhiguang)\
**Post date:** [June 22, 2008, 11:42pm UTC](https://www.ruby-forum.com/t/routing-error-no-route-matches-employee-list-with-method-get/141156/1 "2008-06-22T23:42:44Z")

</div>

hi,

I am very frustrated by this error when I just put together a very  
simple project from one of the textbook on RoR:  
Routing Error  
No route matches “/employee/list” with {:method=\>:get}

For your reference,

#The following is EmployeesController.rb

class EmployeesController \< ApplicationController  
scaffold :employee # create scaffold code for controller

# override scaffold list method

def list  
@employees = Employee.find( :all ) # return an array of all  
Employees  
end # method list  
end # class EmployeeController

# The following is Employee.rb

class Employee \< ActiveRecord::Base  
end

# And the following is list.rhtml,
\<?xml version = "1.0" encoding = "utf-8"?\> List of Employees 
# List of Employees

 \<% for employee in @employees %\> 1. \<%= employee.first\_name %\> \<%= employee.last\_name %\>
 \<% end %\> 

PLEASE HELP!!!  
Zhiguang

---

<div class="post-metadata">

**Author:** ![zhiguang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/54ee81/32.png) [@zhiguang](https://www.ruby-forum.com/u/zhiguang)\
**Post date:** [June 22, 2008, 11:50pm UTC](https://www.ruby-forum.com/t/routing-error-no-route-matches-employee-list-with-method-get/141156/2 "2008-06-22T23:50:20Z")

</div>

On 22 Jun 2008, at 20:06, zhiguang wrote:

> #The following is EmployeesController.rb
> 
> class EmployeesController \< ApplicationController

if your controller is employees then (in the absence of any extra  
routes being defined) the url you should be hitting is /employees/list

Fred

---

<div class="post-metadata">

**Author:** ![zhiguang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/54ee81/32.png) [@zhiguang](https://www.ruby-forum.com/u/zhiguang)\
**Post date:** [June 23, 2008, 3:52am UTC](https://www.ruby-forum.com/t/routing-error-no-route-matches-employee-list-with-method-get/141156/3 "2008-06-23T03:52:32Z")

</div>

Yes that fixes it, but only if I comment out the line

```
 scaffold :employee # create scaffold code for controller

```

in EmployeesController.rb. If I keep that line there, I still have  
trouble when hitting /employees/new etc.

I think I need help with the way how “scaffold” works. Thanks!

On Jun 22, 5:49 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![zhiguang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/54ee81/32.png) [@zhiguang](https://www.ruby-forum.com/u/zhiguang)\
**Post date:** [June 23, 2008, 5:40am UTC](https://www.ruby-forum.com/t/routing-error-no-route-matches-employee-list-with-method-get/141156/4 "2008-06-23T05:40:42Z")

</div>

That macro was removed from recent versions of Rails. It sounds like  
your book is rather out of date unfortunately.

You can still generate scaffolding like so (from the command line):

```
script/generate scaffold employees

```

That will give you the controller, model, and test files rather than  
generating most of the code at runtime like the scaffold method did  
before.

–Jeremy

On Sun, Jun 22, 2008 at 8:51 PM, zhiguang [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Jun 22, 5:49 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> > > ```
> > > No route matches "/employee/list" with {:method=>:get}
> > > 
> > > ```
> > 
> > Fred

–  
[http://jeremymcanally.com/](http://jeremymcanally.com/)  
[http://entp.com](http://entp.com)

Read my books:  
Ruby in Practice ([Ruby in Practice](http://manning.com/mcanally/))  
My free Ruby e-book ([http://humblelittlerubybook.com/](http://humblelittlerubybook.com/))

Or, my blogs:

> **[Site not found · DreamHost](http://mrneighborly.com)**
>
> The owner of this domain has not yet uploaded their website.

[http://rubyinpractice.com](http://rubyinpractice.com)
