path helper issue in rails 3 -


i migrating application rails 2.3 rails 3.1, using path helper student_teacher_path(@student,teacher.id), used work in rails 2.3 if teacher.id nil mean did not generate exception in 2.3.

but rails 3.1 getting exception actionview::template::error (no route matches {:action=>"show", :controller=>"teachers", :student_id=>#<student id:>,nil})

how handle in rails 3.1. there better way other using if else , check if teacher.id nil , display data accordingly.

any suggestion appreciated, thanks.


Comments