# Getting wrong route - fairly complete error description

**URL:** <https://www.ruby-forum.com/t/getting-wrong-route-fairly-complete-error-description/124384>\
**Category:** Rails\
**Created:** [December 28, 2007, 6:59am UTC](https://www.ruby-forum.com/t/getting-wrong-route-fairly-complete-error-description/124384 "2007-12-28T06:59:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Post date:** [December 28, 2007, 6:59am UTC](https://www.ruby-forum.com/t/getting-wrong-route-fairly-complete-error-description/124384/1 "2007-12-28T06:59:02Z")

</div>

OK, I have a routing problem, that seems to be working in the console,  
but not in the app.

I have people that have nested tasks, like so:

* * *

# routes.rb

## map.resources :people do |person| person.resources :phone\_notes person.resources :documents person.resources :tasks, :member =\> {:complete =\> :put} end map.resources :tasks, :member =\> {:complete =\> :put}

And then if I go into irb and try to recognize and generate those  
routes, all is good:

* * *

> > rs = ActionController::Routing::Routes  
> > rs.recognize\_path(“/people/9/tasks/95/complete”, :method =\> :put)  
> > =\> {:action=\>“complete”, :person\_id=\>“9”, :controller=\>“tasks”,  
> > :id=\>“95”}  
> > rs.generate({:action=\>“update”, :person\_id=\>“9”,  
> > :controller=\>“tasks”, :id=\>“95”})  
> > =\> “/people/9/tasks/95/complete”

* * *

So that is all good.

Then rake routes gives me a list which also shows things are good:

* * *

## complete\_person\_task PUT /people/:person\_id/tasks/:id/complete {:controller =\> “tasks”, :action =\> “complete”}

But then in my people/show view I have:

* * *

## \<%= button\_to “Done”, :url =\> complete\_person\_task\_path(task), :method =\> :put -%\>

Which generates this URL:

* * *

## [http://127.0.0.1:3000/people/9?method=put&url=%2Fpeople%2F9%2Ftasks%2F95%2Fcomplete](http://127.0.0.1:3000/people/9?method=put&url=%2Fpeople%2F9%2Ftasks%2F95%2Fcomplete)

Which gives the following error:

* * *

## Unknown action No action responded to 9003000000071902

So obviously the route is not tagging on the custom nested route I have  
made.

So I disabled the “default” routes at the bottom and then I get:

* * *

ActionController::MethodNotAllows

Only get, put, and delete requests are allowed

Request Parameters:

## {“url”=\>“/people/9/tasks/95/complete”, “method”=\>“put” }

Anyone got any ideas? I am sure it is something simple, but just  
tearing my hair out on this one.

Regards

Mikel

---

<div class="post-metadata">

**Author:** ![Mikel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Post date:** [December 28, 2007, 7:00am UTC](https://www.ruby-forum.com/t/getting-wrong-route-fairly-complete-error-description/124384/2 "2007-12-28T07:00:47Z")

</div>

On Dec 28, 2007 4:58 PM, Mikel L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ## Which gives the following error:
> 
> ## Unknown action No action responded to 9003000000071902

Obviously this 9003000000071902 is a mistake. Should be 9 which is  
the person ID. Don’t ask… cut and paste deamons

Mikel
