Вложенный ресурс с Devise - Rails3

Я пытаюсь настроить контроллер профилей для работы с зарегистрированными участниками.

Я создал модель Профиль и контроллер и добавил однозначное отношение , добавив own_to: member в мою модель profile.rb и has_one: profile в моя модель member.rb .

Для создания вложенного ресурса я использовал:

devise_for :members, :path => "accounts",:path_names => { :sign_in => "login", :sign_out => "logout", :sign_up => "register" }

resources :members do
  resources :profiles
end

Вызов rake routes output

     member_profiles GET    /members/:member_id/profiles(.:format)          {:action=>"index", :controller=>"profiles"}
                     POST   /members/:member_id/profiles(.:format)          {:action=>"create", :controller=>"profiles"}
  new_member_profile GET    /members/:member_id/profiles/new(.:format)      {:action=>"new", :controller=>"profiles"}
 edit_member_profile GET    /members/:member_id/profiles/:id/edit(.:format) {:action=>"edit", :controller=>"profiles"}
      member_profile GET    /members/:member_id/profiles/:id(.:format)      {:action=>"show", :controller=>"profiles"}
                     PUT    /members/:member_id/profiles/:id(.:format)      {:action=>"update", :controller=>"profiles"}
                     DELETE /members/:member_id/profiles/:id(.:format)      {:action=>"destroy", :controller=>"profiles"}

Going to localhost: 3000 / members / 1 / profiles в браузере правильно перенаправляет меня на страницу profiles # index , но когда я пытаюсь вызвать member_profiles_path , происходит сбой со следующей ошибкой:

No route matches {:controller=>"profiles"}

Кто-нибудь может увидеть где я здесь ошибаюсь? Я использую rails 3.0.3.

10
задан davegson 27 April 2015 в 12:40
поделиться