# Playing with routes

**URL:** <https://www.ruby-forum.com/t/playing-with-routes/168225>\
**Category:** Rails\
**Created:** [May 18, 2009, 3:22pm UTC](https://www.ruby-forum.com/t/playing-with-routes/168225 "2009-05-18T15:22:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shinkaku](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@shinkaku](https://www.ruby-forum.com/u/shinkaku)\
**Post date:** [May 18, 2009, 3:22pm UTC](https://www.ruby-forum.com/t/playing-with-routes/168225/1 "2009-05-18T15:22:02Z")

</div>

Hi,

I’m currently playing with routes, and can’t seem to find the solution  
for this

i want to change the link of edit for a person  
at the moment I have in route  
map.resources :persons

and in the index of person’s view folder i have  
edit\_person\_path(person)

but it creates the link to  
/persons/11/edit

i would like to change it like delete  
/persons/11

I tried to do \<link\_to “edit”,person , :method=\>:get\>  
but it brings me to the show, which is the problem , I would like in  
routes to say all :get for this persons goes to edit and not show.

thanks

---

<div class="post-metadata">

**Author:** ![shinkaku](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@shinkaku](https://www.ruby-forum.com/u/shinkaku)\
**Post date:** [May 18, 2009, 3:40pm UTC](https://www.ruby-forum.com/t/playing-with-routes/168225/2 "2009-05-18T15:40:00Z")

</div>

Run a

rake routes \>routes.lst

then look at the routes.lst file. This wil show you all the routes that  
mapping a resource generates for you by default.

What you’re trying to do is alter the default behavior of restful  
routing. Your desired edit route is the default routing for show. If  
you override that, then you have to provide an alternative for the show  
method.

If this is a pervasive desire that you simply _must_ have, then I’d  
suggest forgoing the restful routes in general, and dropping back to the  
old routing method.

Get rid of the resource mapping, and “roll your own” routes. But the  
nice thing about restful routes is the notion of programming by  
convention

---

<div class="post-metadata">

**Author:** ![shinkaku](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@shinkaku](https://www.ruby-forum.com/u/shinkaku)\
**Post date:** [May 18, 2009, 3:46pm UTC](https://www.ruby-forum.com/t/playing-with-routes/168225/3 "2009-05-18T15:46:31Z")

</div>

Hi,

I wanted to keep the restful way, but see if was possible to just edit  
show as I’m not using it for person. but if it is only possible by using  
the old routing method, then I guess it is not what I want.

thank you

Ar Chron wrote:

> Run a
> 
> rake routes \>routes.lst
> 
> then look at the routes.lst file. This wil show you all the routes that  
> mapping a resource generates for you by default.
> 
> What you’re trying to do is alter the default behavior of restful  
> routing. Your desired edit route is the default routing for show. If  
> you override that, then you have to provide an alternative for the show  
> method.
> 
> If this is a pervasive desire that you simply _must_ have, then I’d  
> suggest forgoing the restful routes in general, and dropping back to the  
> old routing method.
> 
> Get rid of the resource mapping, and “roll your own” routes. But the  
> nice thing about restful routes is the notion of programming by  
> convention
