# RESTful Routes not working - Switches ID and Action

**URL:** <https://www.ruby-forum.com/t/restful-routes-not-working-switches-id-and-action/160855>\
**Category:** Rails\
**Created:** [February 20, 2009, 11:05am UTC](https://www.ruby-forum.com/t/restful-routes-not-working-switches-id-and-action/160855 "2009-02-20T11:05:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![steffen\_w](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/eb8c5e/32.png) [@steffen\_w](https://www.ruby-forum.com/u/steffen_w)\
**Post date:** [February 20, 2009, 11:05am UTC](https://www.ruby-forum.com/t/restful-routes-not-working-switches-id-and-action/160855/1 "2009-02-20T11:05:42Z")

</div>

Hi,

I would like to ask for some suggestions on my problem with Routes. It’s  
probably pretty simpel.

This link:

\<%= link\_to image\_tag(“…”, :alt =\> “…”, :title =\> “…”),  
edit\_brand\_path(brand) %\>

Results in this URL:

[http://localhost:3000/brands/21/edit](http://localhost:3000/brands/21/edit)

And echos this:

“Unknown action - No action responded to 21”

When I type [http://localhost:3000/brands/edit/21](http://localhost:3000/brands/edit/21), everything is fine.  
There must be some problem with my resource. I have this in routes.rb

map.resources :brands

The application also doesn’t seem to update and create brands, which  
seems to come from the same problem. I pretty much copy and pasted the  
model from other ones, so my guess is, that I forgot something basic.

I got:  
models/brand.rb  
views/brands/…  
controllers/brands\_controller.rb

Thanks very much!

Steffen

---

<div class="post-metadata">

**Author:** ![steffen\_w](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/eb8c5e/32.png) [@steffen\_w](https://www.ruby-forum.com/u/steffen_w)\
**Post date:** [February 20, 2009, 11:18am UTC](https://www.ruby-forum.com/t/restful-routes-not-working-switches-id-and-action/160855/2 "2009-02-20T11:18:03Z")

</div>

Okay, told this problem to my colleague (no Rails guy), just in an  
abstract form. And when I told him “Normally I just have to put  
map.resource in routes.db” it hit me: I didn’t restart the server.  
Problem solved.

Sorry for spamming the list, maybe it helps the next newbie like me.
