# Inexplicable routing problem

**URL:** <https://www.ruby-forum.com/t/inexplicable-routing-problem/135203>\
**Category:** Rails\
**Created:** [April 19, 2008, 6:41am UTC](https://www.ruby-forum.com/t/inexplicable-routing-problem/135203 "2008-04-19T06:41:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubynuby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ba9def/32.png) [@rubynuby](https://www.ruby-forum.com/u/rubynuby)\
**Post date:** [April 19, 2008, 6:41am UTC](https://www.ruby-forum.com/t/inexplicable-routing-problem/135203/1 "2008-04-19T06:41:29Z")

</div>

somehow I broke my RESTful edit action and can’t figure out how.

map.resources :posts

when I open

/posts/10/edit

the action\_name is ‘edit 10’ rather than ‘edit’

and if I hit reload or try to edit another post, I get

No action responded to edit 10

Can someone give me a clue what could be happening here?

---

<div class="post-metadata">

**Author:** ![rubynuby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ba9def/32.png) [@rubynuby](https://www.ruby-forum.com/u/rubynuby)\
**Post date:** [April 19, 2008, 7:35am UTC](https://www.ruby-forum.com/t/inexplicable-routing-problem/135203/2 "2008-04-19T07:35:01Z")

</div>

can you test it :  
map.edit ‘posts/:action/:id’, :controller =\> ‘post’, :action =\> ‘edit’

OR

map.edit ‘posts/:action’,  
:controller =\> ‘post’, :action =\> ‘edit’,  
:requirements =\> { :id =\> /\d+/},  
:id =\> nil

> when I open
> 
> /posts/10/edit

it is the same like :  
map.edit ‘posts/:id/:action’, :controller =\> ‘post’, :action =\> ‘edit’

> the action\_name is ‘edit 10’ rather than ‘edit’

Are you sure that the :action =\> “edit 10” not :action =\> “edit\_10” ?

> No action responded to edit 10

Is 10 id?

Regard,

Reinhart  
[http://teapoci.blogspot.com](http://teapoci.blogspot.com)

---

<div class="post-metadata">

**Author:** ![rubynuby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ba9def/32.png) [@rubynuby](https://www.ruby-forum.com/u/rubynuby)\
**Post date:** [April 19, 2008, 12:52pm UTC](https://www.ruby-forum.com/t/inexplicable-routing-problem/135203/3 "2008-04-19T12:52:13Z")

</div>

yikes, it tunrs out I had a piece of code in my helper where I did  
this

str = controller.action\_name \<\< ’ ’ \<\< …

instead of

str = controller.action\_name + ’ ’ + …  
or  
str = “#{controller.action\_name} …”

D’OH! I knew it was something trivial and stupid.

On Apr 18, 10:35 pm, Visit Indonesia 2008 \<rails-mailing-l…@andreas-
