0

如何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

4

1 回答 1

2

可能会用到

resources :questions do
  get 'new/answer', :on => :member
end

并将通过rake routes

于 2012-09-04T04:44:45.053 回答