如何render :new
并将位置设置为question/:id/new/answer
?
render :location => new_question_path
将位置设置为question/:id/answer
render :location => "/question/#{params[:id]}/new/answer"
也无效。
相关路线:get '/question/:id/new/answer' => 'answers#new', as: :new_answer
答案 0 :(得分:2)
可能正在使用
resources :questions do
get 'new/answer', :on => :member
end
并将通过rake routes