# Nested namespaces with nested resources

**URL:** <https://www.ruby-forum.com/t/nested-namespaces-with-nested-resources/154213>\
**Category:** Rails\
**Created:** [November 26, 2008, 12:56pm UTC](https://www.ruby-forum.com/t/nested-namespaces-with-nested-resources/154213 "2008-11-26T12:56:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gzigzigzeo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a88e57/32.png) [@gzigzigzeo](https://www.ruby-forum.com/u/gzigzigzeo)\
**Post date:** [November 26, 2008, 12:56pm UTC](https://www.ruby-forum.com/t/nested-namespaces-with-nested-resources/154213/1 "2008-11-26T12:56:39Z")

</div>

Hello.

I have a problem with url\_for resource.

My models:

class QuestionLibrary::Group \< ActiveRecord::Base  
class QuestionLibrary::Competence \< ActiveRecord::Base  
set\_table\_name “question\_library\_competences”  
belongs\_to :group  
has\_many :questions  
end

My controllers:  
class Admin::QuestionLibrary::GroupsController \< ApplicationController  
class Admin::QuestionLibrary::CompetencesController \<  
ApplicationController

My routes:

map.namespace :admin do |admin|  
admin.namespace :question\_library do |question\_library|  
question\_library.resources :groups, :collection =\> { :reoder  
=\> :post } do |groups|  
groups.resources :competences, :collection =\> { :reoder  
=\> :post } do |competences|  
competences.resources :questions  
end  
end  
end  
end

My view:

\<% form\_for [:admin. @group, @competence] do |f| %\>

fails with:

undefined method  
`admin\_question\_library\_group\_question\_library\_competences\_path’

In cause of url\_for adds namespace prefix to each model. May I fix it  
without specifying :url arg to url\_for =\> … ?
