# Linkt\_to problems

**URL:** <https://www.ruby-forum.com/t/linkt-to-problems/142211>\
**Category:** Rails\
**Created:** [July 4, 2008, 4:47pm UTC](https://www.ruby-forum.com/t/linkt-to-problems/142211 "2008-07-04T16:47:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![viliwort](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/bc8723/32.png) [@viliwort](https://www.ruby-forum.com/u/viliwort)\
**Post date:** [July 4, 2008, 4:47pm UTC](https://www.ruby-forum.com/t/linkt-to-problems/142211/1 "2008-07-04T16:47:58Z")

</div>

I can’t explain where those differences come from.

In one Project I can use the link\_to without any problems.  
Like this:  
\<%= link\_to “LINKNAME”, :action =\> “destroy”, :id =\> ID %\>

But in another project… That happens

\<%= link\_to “delete”, :action =\> “destroy”, :id =\> ticket.id %\>  
\<%= link\_to “edit”, :action =\> “edit”, :id =\> ticket.id %\>

and that creates a link to → [http://localhost:3000/tickets/2](http://localhost:3000/tickets/2)  
 → [http://localhost:3000/tickets/2/edit](http://localhost:3000/tickets/2/edit)

What i want is → [http://localhost:3000/tickets/destroy/2](http://localhost:3000/tickets/destroy/2)  
 → [http://localhost:3000/tickets/edit/2](http://localhost:3000/tickets/edit/2)

Slight but important difference.

Can somebody tell me, where I have to configure this?

Thanks a lot!!!

---

<div class="post-metadata">

**Author:** ![viliwort](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/bc8723/32.png) [@viliwort](https://www.ruby-forum.com/u/viliwort)\
**Post date:** [July 4, 2008, 8:26pm UTC](https://www.ruby-forum.com/t/linkt-to-problems/142211/2 "2008-07-04T20:26:15Z")

</div>

use the :method=\> qualifier.

---

<div class="post-metadata">

**Author:** ![viliwort](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/bc8723/32.png) [@viliwort](https://www.ruby-forum.com/u/viliwort)\
**Post date:** [July 8, 2008, 8:04am UTC](https://www.ruby-forum.com/t/linkt-to-problems/142211/3 "2008-07-08T08:04:26Z")

</div>

Mukund wrote:

> use the :method=\> qualifier.

I tried that, but it gives me this:  
[http://localhost:3000/tickets/index/2?method=edit](http://localhost:3000/tickets/index/2?method=edit)

Did I do something wrong?

---

<div class="post-metadata">

**Author:** ![viliwort](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/bc8723/32.png) [@viliwort](https://www.ruby-forum.com/u/viliwort)\
**Post date:** [July 8, 2008, 8:19am UTC](https://www.ruby-forum.com/t/linkt-to-problems/142211/4 "2008-07-08T08:19:03Z")

</div>

Ma Ka wrote:

> Mukund wrote:
> 
> > use the :method=\> qualifier.
> 
> I tried that, but it gives me this:  
> [http://localhost:3000/tickets/index/2?method=edit](http://localhost:3000/tickets/index/2?method=edit)
> 
> Did I do something wrong?

Dont be worry about that, it is natural link process if you not describe  
link rule in config/routes.rb, like :

map.destroy\_tiket ‘:controller/destroy/:id’, :controller =\> ‘tickets’,  
:action =\> ‘destroy’

I hope my suggestion can help you. good luck.

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