# Rails Recipes Book: Routing Error

**URL:** <https://www.ruby-forum.com/t/rails-recipes-book-routing-error/58688>\
**Category:** Rails\
**Created:** [April 24, 2006, 9:56pm UTC](https://www.ruby-forum.com/t/rails-recipes-book-routing-error/58688 "2006-04-24T21:56:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kublai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a3d4f5/32.png) [@kublai](https://www.ruby-forum.com/u/kublai)\
**Post date:** [April 24, 2006, 9:56pm UTC](https://www.ruby-forum.com/t/rails-recipes-book-routing-error/58688/1 "2006-04-24T21:56:27Z")

</div>

Hi,  
I’m working on the first rails recipe, InPlaceEditing, and following the  
instructions very carefully. After generating the scaffold for Contact,  
I then go to the page, thus:

[http://localhost:3000/contacts/](http://localhost:3000/contacts/)

I get this error:

Routing Error  
Recognition failed for “/contacts/”

What should I be checking for to resolve this problem?

Thanks.

---

<div class="post-metadata">

**Author:** ![kublai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a3d4f5/32.png) [@kublai](https://www.ruby-forum.com/u/kublai)\
**Post date:** [April 24, 2006, 11:25pm UTC](https://www.ruby-forum.com/t/rails-recipes-book-routing-error/58688/2 "2006-04-24T23:25:22Z")

</div>

You probably don’t still have the output of your script/generate. How  
about showing us your controller  
/app/controllers/contacts\_controller.rb. Also make sure you have all  
the views that are listed in the Recipe book, in the output of the  
script/generate command.

Michael.

---

<div class="post-metadata">

**Author:** ![kublai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a3d4f5/32.png) [@kublai](https://www.ruby-forum.com/u/kublai)\
**Post date:** [April 25, 2006, 5:50am UTC](https://www.ruby-forum.com/t/rails-recipes-book-routing-error/58688/3 "2006-04-25T05:50:52Z")

</div>

Thanks for the reply.

There are 6 files in views/contacts:  
\_form.rhtml, list.rhtml, show.rhtml, edit.rhtml, new.rhtml,  
show.rhtml.default.  
There are 2 files in views/layouts:  
application.rhtml, contacts.rhtml

Here’s what’s in contacts\_controller.rb:

#—

# Excerpted from “Rails Recipes”

# We make no guarantees that this code is fit for any purpose.

# Visit [http://www.pragmaticprogrammer.com/titles/fr\_rr](http://www.pragmaticprogrammer.com/titles/fr_rr) for more book

information.  
#—  
class ContactsController \< ApplicationController

Contact.content\_columns.each do |column|  
in\_place\_edit\_for :contact, column.name  
end

def index  
list  
render :action =\> ‘list’  
end

def list  
@contact\_pages, @contacts = paginate :contacts, :per\_page =\> 10  
end

def show  
@contact = Contact.find(params[:id])  
end

def new  
@contact = Contact.new  
end

def create  
@contact = Contact.new(params[:contact])  
if @contact.save  
flash[:notice] = ‘Contact was successfully created.’  
redirect\_to :action =\> ‘list’  
else  
render :action =\> ‘new’  
end  
end

def edit  
@contact = Contact.find(params[:id])  
end

def update  
@contact = Contact.find(params[:id])  
if @contact.update\_attributes(params[:contact])  
flash[:notice] = ‘Contact was successfully updated.’  
redirect\_to :action =\> ‘show’, :id =\> @contact  
else  
render :action =\> ‘edit’  
end  
end

def destroy  
Contact.find(params[:id]).destroy  
redirect\_to :action =\> ‘list’  
end  
end

Thanks for the help!

Michael T. wrote:

> You probably don’t still have the output of your script/generate. How  
> about showing us your controller  
> /app/controllers/contacts\_controller.rb. Also make sure you have all  
> the views that are listed in the Recipe book, in the output of the  
> script/generate command.
> 
> Michael.

---

<div class="post-metadata">

**Author:** ![kublai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a3d4f5/32.png) [@kublai](https://www.ruby-forum.com/u/kublai)\
**Post date:** [April 26, 2006, 12:14am UTC](https://www.ruby-forum.com/t/rails-recipes-book-routing-error/58688/4 "2006-04-26T00:14:32Z")

</div>

Nothing odd here. What about your config/routing.rb file.

Michael
