# Issue when creating an new action in my routes.rb

**URL:** <https://www.ruby-forum.com/t/issue-when-creating-an-new-action-in-my-routes-rb/140062>\
**Category:** Rails\
**Created:** [June 10, 2008, 2:48pm UTC](https://www.ruby-forum.com/t/issue-when-creating-an-new-action-in-my-routes-rb/140062 "2008-06-10T14:48:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tranquiliste](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@tranquiliste](https://www.ruby-forum.com/u/tranquiliste)\
**Post date:** [June 10, 2008, 2:48pm UTC](https://www.ruby-forum.com/t/issue-when-creating-an-new-action-in-my-routes-rb/140062/1 "2008-06-10T14:48:17Z")

</div>

Hello,

Hello, I have an issue when I try to setup a new action in my  
resources.  
I have the following definition in my routes.rb file where I try to  
add the “validate” action

map.resources :buildings do |building|  
building.resources :blocks  
building.resources :blocks, :collection =\> {:validate =\> :get}  
end  
Whwn I exucute the rake route, I get as expected :  
validate\_building\_blocks GET /buildings/:building\_id/blocks/  
validate {:controller=\>“blocks”, :action=\>“validate”}

I have in my view, the following link:  
\<%= link\_to("#{custom\_message(:building\_step\_3)}",  
validate\_building\_blocks\_path(@building)) %\>

But when I click on it, it tries to execute the “show” action of the  
“block” controller

Do you know what I am doing wrong?  
I use rails 2.0.2

Thanks

---

<div class="post-metadata">

**Author:** ![tranquiliste](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@tranquiliste](https://www.ruby-forum.com/u/tranquiliste)\
**Post date:** [June 10, 2008, 3:16pm UTC](https://www.ruby-forum.com/t/issue-when-creating-an-new-action-in-my-routes-rb/140062/2 "2008-06-10T15:16:01Z")

</div>

I had my answer on another forum.  
The issue came from the line  
building.resources :blocks

To be deleted (duplicate with the second line)
