title: path helper issue in rails 3
body: <p>I am migrating a application from rails 2.3 to rails 3.1, i am using a path helper like <strong><code>student_teacher_path(@student,teacher.id)</code></strong>, this used to work in <strong>rails 2.3 even if teacher.id is nil</strong> i mean it did not generate a exception in 2.3. </p>
  
  <p>But with rails 3.1 i am getting a exception like <strong><code>ActionView::Template::Error (No route matches {:action=&gt;"show", :controller=&gt;"teachers", :student_id=&gt;#&lt;Student id:&gt;,nil})</code></strong></p>
  
  <p>How do i handle this in rails 3.1. Is there any better way to this other than using a if else and check if teacher.id is nil and display data accordingly. </p>
  
  <p>Any suggestion will be appreciated, Thanks.</p>