Nested namespaces with nested resources


#1

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 => … ?