# Link\_to problem

**URL:** <https://www.ruby-forum.com/t/link-to-problem/144990>\
**Category:** Rails\
**Created:** [August 5, 2008, 12:26am UTC](https://www.ruby-forum.com/t/link-to-problem/144990 "2008-08-05T00:26:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 12:26am UTC](https://www.ruby-forum.com/t/link-to-problem/144990/1 "2008-08-05T00:26:13Z")

</div>

\<%= link\_to “New”, { :controller =\> :threads, :action=\>:new\_requirement  
} %\>

When I click on the link it displays the error page:

Unknown action  
No action responded to show

Why is this? Thanks!

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 2:19am UTC](https://www.ruby-forum.com/t/link-to-problem/144990/2 "2008-08-05T02:19:29Z")

</div>

This can sound stupid, but, ¿Do u define the function :new\_requeriment  
in you threads controller?

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 8:56am UTC](https://www.ruby-forum.com/t/link-to-problem/144990/3 "2008-08-05T08:56:00Z")

</div>

Looks to me that you are using “map.resources :threads” in your  
routes.rb and that maps anything with /threads/whatever to :action =\>  
show, :id =\> “whatever”.

To get around this, you might want to simply use “new” actoin that’s  
mapped by standard when using restful routing. Or, if you really want  
“new\_requirement”, please consider adding :collection =\>  
{ :new\_requirement =\> :get } to your resource section in routes.rb.

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 9:08am UTC](https://www.ruby-forum.com/t/link-to-problem/144990/4 "2008-08-05T09:08:16Z")

</div>

Sounds to me like requirements are another resource. I recommend  
making another controller for requirements if this is so.

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 6:09pm UTC](https://www.ruby-forum.com/t/link-to-problem/144990/5 "2008-08-05T18:09:36Z")

</div>

routes.rb:  
map.resources :users, :threads

I still get the same error.

And I’m not exactly sure what you’re telling me to do Hubert.

Thanks

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 2:16pm UTC](https://www.ruby-forum.com/t/link-to-problem/144990/6 "2008-08-05T14:16:47Z")

</div>

Ryan B. wrote:

> Sounds to me like requirements are another resource. I recommend  
> making another controller for requirements if this is so.

Hi , justint  
Define method or action in ur controller ! and also emphasis on naming  
conversation .

\<=% link\_to “New” :controller =\> “controller\_name”, :action  
=\>“action\_name” ,:id =\>@instant\_var%\>
