2

ネストされたリソースに対して form_for を機能させることができず、おかしくなっています。

ルート:

namespace :teacher do
    resources :lessons do
      resources :questions
      resources :invites
      resources :responses
    end
end

app/views/teacher/questions/_form.html.haml:

= simple_form_for [:teacher, @question], :html => { :class => 'form-horizontal form-lineup' } do |f|

  ..

index、show、destroy アクションはすべて正しく機能します。を呼び出すと編集アクションのみが失敗します:

teachers/1/questions/1/edit

スロー:

No route matches {:action=>"show", :controller=>"teacher/questions", :teacher_id=>#<Teacher::Question id: 1, teacher_id: 5, user_id: nil, name: "asdf", email: "dsafsd", expire_at: "2013-12-23 19:36:00", created_at: "2013-12-23 19:36:25", updated_at: "2013-12-23 19:36:25">, :id=>nil, :format=>nil} missing required keys: [:id]
4

1 に答える 1